diff --git a/CMake/OTBApplicationMacros.cmake b/CMake/OTBApplicationMacros.cmake index d354b4cf72c5fce9323f4fa44ea6d2e6aa371cdb..49081c7d3988ea4d298d0ccd78c72b228221a199 100644 --- a/CMake/OTBApplicationMacros.cmake +++ b/CMake/OTBApplicationMacros.cmake @@ -67,75 +67,51 @@ macro(otb_create_application) endif() else() install(TARGETS ${APPLICATION_TARGET_NAME} - LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + LIBRARY DESTINATION lib COMPONENT RuntimeLibraries) endif() - # Generate a quickstart script in the build dir - #if (NOT WIN32) - - # What is the path to the applications - # a MODULE target is always treated as LIBRARY - get_target_property(APPLICATION_BINARY_PATH ${APPLICATION_TARGET_NAME} LIBRARY_OUTPUT_DIRECTORY) - - if (NOT APPLICATION_BINARY_PATH) - set(APPLICATION_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR}) - endif() - - if (WIN32) - set(SCRIPT_CLI_SOURCE ${OTB_SOURCE_DIR}/CMake/otbcli_app.bat.in) - set(SCRIPT_CLI_INTERMEDIATE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/otbcli_${APPLICATION_NAME}.bat) - set(SCRIPT_CLI_INSTALLABLE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/otbcli_${APPLICATION_NAME}.bat) - else() - set(SCRIPT_CLI_SOURCE ${OTB_SOURCE_DIR}/CMake/otbcli_app.sh.in) - set(SCRIPT_CLI_INTERMEDIATE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/otbcli_${APPLICATION_NAME}) - set(SCRIPT_CLI_INSTALLABLE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/otbcli_${APPLICATION_NAME}) - endif() - - if (EXISTS ${SCRIPT_CLI_SOURCE}) - # Generate a script in the build dir, next to the cli launcher - configure_file( ${SCRIPT_CLI_SOURCE} - ${SCRIPT_CLI_INTERMEDIATE} - @ONLY ) - - # Copy it next to the application shared lib, and give executable rights - file(COPY ${SCRIPT_CLI_INTERMEDIATE} - DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - - # Install a version of this script if we are inside the OTB build - install(PROGRAMS ${SCRIPT_CLI_INSTALLABLE} - DESTINATION ${OTB_INSTALL_RUNTIME_DIR} - COMPONENT Runtime) - endif() - - if (WIN32) - set(SCRIPT_GUI_SOURCE ${OTB_SOURCE_DIR}/CMake/otbgui_app.bat.in) - set(SCRIPT_GUI_INTERMEDIATE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/otbgui_${APPLICATION_NAME}.bat) - set(SCRIPT_GUI_INSTALLABLE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/otbgui_${APPLICATION_NAME}.bat) - else() - set(SCRIPT_GUI_SOURCE ${OTB_SOURCE_DIR}/CMake/otbgui_app.sh.in) - set(SCRIPT_GUI_INTERMEDIATE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/otbgui_${APPLICATION_NAME}) - set(SCRIPT_GUI_INSTALLABLE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/otbgui_${APPLICATION_NAME}) - endif() - - if (EXISTS ${SCRIPT_GUI_SOURCE}) - # Generate a script in the build dir, next to the cli launcher - configure_file( ${SCRIPT_GUI_SOURCE} - ${SCRIPT_GUI_INTERMEDIATE} - @ONLY ) - - # Copy it next to the application shared lib, and give executable rights - file(COPY ${SCRIPT_GUI_INTERMEDIATE} - DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - - # Install a version of this script if we are inside the OTB build - install(PROGRAMS ${SCRIPT_GUI_INSTALLABLE} - DESTINATION ${OTB_INSTALL_RUNTIME_DIR} - COMPONENT Runtime) - endif() - #endif() + # What is the path to the applications + # a MODULE target is always treated as LIBRARY + get_target_property(APPLICATION_BINARY_PATH ${APPLICATION_TARGET_NAME} LIBRARY_OUTPUT_DIRECTORY) + + if (NOT APPLICATION_BINARY_PATH) + set(APPLICATION_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR}) + endif() + + if(CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(_script_output_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + else() + set(_script_output_dir ${CMAKE_BINARY_DIR}/bin) + endif() + if(OTB_INSTALL_RUNTIME_DIR) + set(_script_install_dir ${OTB_INSTALL_RUNTIME_DIR}) + else() + set(_script_install_dir bin) + endif() + set(INTERMEDIATE_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) + set(SCRIPT_EXT "") + if(WIN32) + set(SCRIPT_EXT ".bat") + endif() + + # ----- Create and install launcher scripts ------ + foreach(type CLI GUI) + string(TOLOWER "${type}" type_lower) + set(SCRIPT_NAME otb${type_lower}_${APPLICATION_NAME}${SCRIPT_EXT}) + otb_write_app_launcher( + NAME ${APPLICATION_NAME} + OUTPUT ${INTERMEDIATE_DIR}/${SCRIPT_NAME} + TYPE ${type}) + # Copy it next to the application shared lib, and give executable rights + file(COPY ${INTERMEDIATE_DIR}/${SCRIPT_NAME} + DESTINATION ${_script_output_dir} + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + # Install a version of this script if we are inside the OTB build + install(PROGRAMS ${_script_output_dir}/${SCRIPT_NAME} + DESTINATION ${_script_install_dir} + COMPONENT Runtime) + endforeach() list(APPEND OTB_APPLICATIONS_NAME_LIST ${APPLICATION_NAME}) list(REMOVE_DUPLICATES OTB_APPLICATIONS_NAME_LIST) @@ -170,3 +146,56 @@ macro(otb_test_application) -testenv ${TESTAPPLICATION_TESTENVOPTIONS}) endif() endmacro() + +macro(otb_write_app_launcher) + cmake_parse_arguments(APPLAUNCHER "" "NAME;OUTPUT;TYPE" "" ${ARGN} ) + if("${APPLAUNCHER_TYPE}" STREQUAL "CLI") + set(_launcher_type "otbcli") + elseif("${APPLAUNCHER_TYPE}" STREQUAL "GUI") + set(_launcher_type "otbgui") + else() + message(FATAL_ERROR "Unknown launcher type : ${APPLAUNCHER_TYPE}, only support CLI and GUI") + endif() + + if(WIN32) + # Launcher script in Batch format + file(WRITE "${APPLAUNCHER_OUTPUT}" +"@echo off +:: +:: Autogenerated by OTB installation process +:: DO NOT MODIFY +:: +set CURRENT_SCRIPT_DIR=%~dp0 +if exist %CURRENT_SCRIPT_DIR%${_launcher_type}.bat ( + :: Prefer using the launcher inside the script dir + set OTB_LAUNCHER=%CURRENT_SCRIPT_DIR%${_launcher_type}.bat +) else ( + :: Use the one from the PATH + set OTB_LAUNCHER=${_launcher_type}.bat +) + +:: start the application +%OTB_LAUNCHER% ${APPLAUNCHER_NAME} %* +") + else() + # Launcher script in Shell format + file(WRITE "${APPLAUNCHER_OUTPUT}" +"#!/bin/sh +# +# Autogenerated by OTB installation process +# DO NOT MODIFY +# +CURRENT_SCRIPT_DIR=$(dirname \"\$0\") +if [ -e \"\$CURRENT_SCRIPT_DIR/${_launcher_type}\" ] ; then + # Prefer using the launcher inside the script dir + OTB_LAUNCHER=$CURRENT_SCRIPT_DIR/${_launcher_type} +else + # Use the one from the PATH + OTB_LAUNCHER=${_launcher_type} +fi + +# start the application +\$OTB_LAUNCHER ${APPLAUNCHER_NAME} \"$@\" +") + endif() +endmacro() diff --git a/CMake/OTBModuleExternal.cmake b/CMake/OTBModuleExternal.cmake index 8fdf2765147e174cdafcc7a268c1c6afbd3b8246..75ce8c229d97a2420acd0d17bdc06197c7596be3 100644 --- a/CMake/OTBModuleExternal.cmake +++ b/CMake/OTBModuleExternal.cmake @@ -76,6 +76,9 @@ else() if(NOT OTB_INSTALL_PACKAGE_DIR) set(OTB_INSTALL_PACKAGE_DIR "lib/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}") endif() + if(NOT OTB_INSTALL_APP_DIR) + set(OTB_INSTALL_APP_DIR lib/otb/applications) + endif() # Use OTB's flags. set(CMAKE_C_FLAGS "${OTB_REQUIRED_C_FLAGS} ${CMAKE_C_FLAGS}") diff --git a/CMake/OTBStandaloneModuleMacros.cmake b/CMake/OTBStandaloneModuleMacros.cmake index 0ae7355212214fb64b6597d5e43ea8667496a57d..b82b04c25609486ef89770d04df889a5a19ca4de 100644 --- a/CMake/OTBStandaloneModuleMacros.cmake +++ b/CMake/OTBStandaloneModuleMacros.cmake @@ -262,7 +262,7 @@ macro(otb_module_impl) set(OTBAPP_BASELINE ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Images) set(OTBAPP_BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB-Applications/Files) - if(${BUILD_TESTING}) + if(BUILD_TESTING) enable_testing() endif() diff --git a/CMake/otbcli_app.bat.in b/CMake/otbcli_app.bat.in deleted file mode 100644 index e4af53d8e5cf0290d45049be10ee673daed9cbb0..0000000000000000000000000000000000000000 --- a/CMake/otbcli_app.bat.in +++ /dev/null @@ -1,18 +0,0 @@ -@echo off -:: -:: Autogenerated by OTB installation process -:: DO NOT MODIFY -:: - -set CURRENT_SCRIPT_DIR=%~dp0 - -if exist %CURRENT_SCRIPT_DIR%otbcli.bat ( - :: Prefer using the launcher inside the script dir - set OTB_CLI_LAUNCHER=%CURRENT_SCRIPT_DIR%otbcli.bat -) else ( - :: Use the one from the PATH - set OTB_CLI_LAUNCHER=otbcli.bat -) - -:: start the application -%OTB_CLI_LAUNCHER% @APPLICATION_NAME@ %* diff --git a/CMake/otbcli_app.sh.in b/CMake/otbcli_app.sh.in deleted file mode 100644 index c073ae192b11e4d34c412835c44bfdf4c4792a25..0000000000000000000000000000000000000000 --- a/CMake/otbcli_app.sh.in +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# -# Autogenerated by OTB installation process -# DO NOT MODIFY -# - -CURRENT_SCRIPT_DIR=$(dirname "$0") - -if [ -e "$CURRENT_SCRIPT_DIR/otbcli" ] -then - # Prefer using the launcher inside the script dir - OTB_CLI_LAUNCHER=$CURRENT_SCRIPT_DIR/otbcli -else - # Use the one from the PATH - OTB_CLI_LAUNCHER=otbcli -fi - -# start the application -$OTB_CLI_LAUNCHER @APPLICATION_NAME@ "$@" diff --git a/CMake/otbgui_app.bat.in b/CMake/otbgui_app.bat.in deleted file mode 100644 index 5752728a54804cdbd6f06d48ae0c85f97d67ec7b..0000000000000000000000000000000000000000 --- a/CMake/otbgui_app.bat.in +++ /dev/null @@ -1,18 +0,0 @@ -@echo off -:: -:: Autogenerated by OTB installation process -:: DO NOT MODIFY -:: - -set CURRENT_SCRIPT_DIR=%~dp0 - -if exist %CURRENT_SCRIPT_DIR%otbgui.bat ( - :: Prefer using the launcher inside the script dir - set OTB_GUI_LAUNCHER=%CURRENT_SCRIPT_DIR%otbgui.bat -) else ( - :: Use the one from the PATH - set OTB_GUI_LAUNCHER=otbgui.bat -) - -:: start the application -%OTB_GUI_LAUNCHER% @APPLICATION_NAME@ %* diff --git a/CMake/otbgui_app.sh.in b/CMake/otbgui_app.sh.in deleted file mode 100644 index 7243475e300ff137b94203ec698f74d192bd80fa..0000000000000000000000000000000000000000 --- a/CMake/otbgui_app.sh.in +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# -# Autogenerated by OTB installation process -# DO NOT MODIFY -# - -CURRENT_SCRIPT_DIR=$(dirname "$0") - -if [ -e "$CURRENT_SCRIPT_DIR/otbgui" ] -then - # Prefer using the launcher inside the script dir - OTB_GUI_LAUNCHER=$CURRENT_SCRIPT_DIR/otbgui -else - # Use the one from the PATH - OTB_GUI_LAUNCHER=otbgui -fi - -# start the application -$OTB_GUI_LAUNCHER @APPLICATION_NAME@ "$@" diff --git a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py index 59019e33e2a0a35c32134412512a82bbae52ab54..70d55ce7c9490d4998b7db595130d0f917bf5576 100755 --- a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py +++ b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py @@ -344,8 +344,8 @@ def GetApplicationExamplePythonSnippet(app,idx,expand = False, inputpath="",outp #app.SetParameterString(param,value) output+= "\t" + appname + ".SetParameterString(" + EncloseString(param) + "," + EncloseString(value) + ")" + linesep if paramtype == otbApplication.ParameterType_Empty: - app.SetParameterString(param,"1") - output+= "\t" + appname + ".SetParameterString("+EncloseString(param)+",\"1\")" + linesep + app.EnableParameter(param) + output+= "\t" + appname + ".EnableParameter("+EncloseString(param)+")" + linesep if paramtype == otbApplication.ParameterType_Int \ or paramtype == otbApplication.ParameterType_Radius \ or paramtype == otbApplication.ParameterType_RAM: diff --git a/Documentation/Cookbook/rst/Installation_Linux.txt b/Documentation/Cookbook/rst/Installation_Linux.txt index bc238f41188379a7e082f6df34cf30180bc519f9..2f3e127104c4eba1aeb41316996177f8d27a94aa 100644 --- a/Documentation/Cookbook/rst/Installation_Linux.txt +++ b/Documentation/Cookbook/rst/Installation_Linux.txt @@ -36,10 +36,14 @@ archive is extracted, the directory structure consists of: - ``share``: A folder containing common resources and copyright mentions. +- ``tool``: A folder containing usefull scripts to test the installation or + to uninstall OTB libraries and headers while keeping all the depedencies. + In order to run the command line launchers, this package doesn’t require any special library that is not present in most modern Linux distributions. There is a small caveat for "expat" though as these binaries depend on "libexpat.so", which can be supplied by most package managers (apt, yum, ...). +Note that this problem only affects versions 6.0 and older. If not already present, it is necessary to install one of the following packages: :: @@ -108,9 +112,9 @@ A: This is due to a conflict with system Qt4 (usually seen on KDE) and Qt4 + gtk Q: Monteverdi and Mapla applications look different from my other applications. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -A: By default, Monteverdi, Mapla and otbapplication (otbgui\_\*) uses a the -system gtk theme. If you can't install GTK on your system you can use the -distributed with the OTB package. Note that using system GTK is the preferred +A: In versions 6.0 and older, Monteverdi, Mapla and otbapplication (otbgui\_\*) +use the system gtk theme. If you can't install GTK on your system you can use the +one distributed with the OTB package. Note that using system GTK is the preferred way with the OTB standalone package as the distributed version of GTK do not work on recent Linux distributions. @@ -122,3 +126,6 @@ To use the distributed GTK libraries you need to set the OTB_USE_LOCAL_GTK: And now start ``monteverdi.sh`` or ``mapla.sh`` from OTB-|release|-Linux64 To get back default behaviour, unset OTB_USE_LOCAL_GTK=1 or set OTB_USE_LOCAL_GTK=0 + +In version 6.2, the Linux binaries are built without GTK support to cut some +dependencies. diff --git a/Documentation/Cookbook/rst/Installation_Macx.txt b/Documentation/Cookbook/rst/Installation_Macx.txt index c004af64d3f1d0679015b608fba8f753ab5c1457..7389c07754cdfabbbda4154feb49ee32db0cb0f8 100644 --- a/Documentation/Cookbook/rst/Installation_Macx.txt +++ b/Documentation/Cookbook/rst/Installation_Macx.txt @@ -25,6 +25,9 @@ Contents of OTB-|release|-Darwin64 is briefly listed below: - ``share``: A folder containing common resources and copyright mentions. +- ``tool``: A folder containing usefull scripts to test the installation or + to uninstall OTB libraries and headers while keeping all the depedencies. + Python bindings ~~~~~~~~~~~~~~~ diff --git a/Documentation/Cookbook/rst/Installation_Windows.txt b/Documentation/Cookbook/rst/Installation_Windows.txt index d49f183da74fce0cfa575f2c8c1004fbcb6aa622..8f4741c77d19e0b127ea75b1de5464ad41c07f95 100644 --- a/Documentation/Cookbook/rst/Installation_Windows.txt +++ b/Documentation/Cookbook/rst/Installation_Windows.txt @@ -18,6 +18,9 @@ and their launchers (both command line and graphical launchers are provided): - ``lib``: A folder containing application DLLs. +- ``tool``: A folder containing usefull scripts to test the installation or + to uninstall OTB libraries and headers while keeping all the depedencies. + The applications can be launched from the Mapla launcher. If you want to use the otbcli and otbgui launchers, you can initialize a command prompt with ``otbenv.bat``. diff --git a/Documentation/Cookbook/rst/recipes/improc.rst b/Documentation/Cookbook/rst/recipes/improc.rst index 0cfeb5b9f3be8f810325be5b1fa0797ebbaf536f..6e9e94e97714f6884113dfd1c75bea8c731d7a94 100644 --- a/Documentation/Cookbook/rst/recipes/improc.rst +++ b/Documentation/Cookbook/rst/recipes/improc.rst @@ -124,7 +124,6 @@ segmentation of very large image with theoretical guarantees of getting identical results to those without tiling. It has been developed by David Youssefi and Julien Michel during David - internship at CNES. For more a complete description of the LSMS method, please refer to the @@ -262,6 +261,35 @@ set the tile size using the *tilesizex* and *tilesizey* parameters. However unlike the *LSMSSegmentation* application, it does not require to write any temporary file to disk. +All-in-one +~~~~~~~~~~ + +The *LargeScaleMeanShift* application is a composite application that chains +all the previous steps: + +- Mean-Shift Smoothing +- Segmentation +- Small region merging +- Vectorization + +Most of the settings from the previous applications are also exposed in this +composite application. The range and spatial radius used for the segmentation +step are half the values used for Mean-Shift smooting, which are obtained from +LargeScaleMeanShift parameters. There are two output modes: vector (default) +and raster. When the raster output is chosen, last step (vectorization) is +skipped. + +:: + + otbcli_LargeScaleMeanShift -in input_image.tif + -spatialr 5 + -ranger 30 + -minsize 10 + -mode.vector.out segmentation_merged.shp + +There is a cleanup option that can be disabled in order to check intermediate +outputs of this composite application. + Dempster Shafer based Classifier Fusion --------------------------------------- diff --git a/Documentation/Cookbook/rst/recipes/pbclassif.rst b/Documentation/Cookbook/rst/recipes/pbclassif.rst index d82ef45724aca938be69b9733988489476f68982..73ab8409d7c8a807f9113ead842c1bbdfeeb5f94 100644 --- a/Documentation/Cookbook/rst/recipes/pbclassif.rst +++ b/Documentation/Cookbook/rst/recipes/pbclassif.rst @@ -72,8 +72,15 @@ classify a set of features on a new vector data file using the -out classifiedData.shp This application outputs a vector data file storing sample values -and classification labels. The output is optional, in this case the -input vector data classification label field is updated. +and classification labels. The output vector file is optional. If no output is +given to the application, the input vector data classification label field is +updated. If a statistics file was used to normalize the features during +training, it shall also be used here, during classification. + +Note that with this application, the machine learning model may come from a +training on image or vector data, it doesn't matter. The only requirement is +that the chosen features to use should be the same as the one used during +training. Validating classification ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -535,6 +542,53 @@ and this image is produced with the commands inside this Figure 2: From left to right: Original image, result image with fusion (with monteverdi viewer) of original image and fancy classification and input image with fancy color classification from labeled image. +Unsupervised learning +--------------------- + +Using the same machine learning framework, it is also possible to perform +unsupervised classification. In this case, the main difference is that +the training samples don't need a real class label. However, in order to use +the same *TrainImagesClassifier* application, you still need to +provide a vector data file with a label field. This vector file will be +used to extract samples for the training. Each label value is can be considered +as a source area for samples, the same logic as in supervised learning is +applied for the computation of extracted samples per area. Hence, for +unsupervised classification, the samples are selected based on classes that are +not actually used during the training. For the moment, only the KMeans +algorithm is proposed in this framework. + +:: + + otbcli_TrainImageClassifier + -io.il image.tif + -io.vd training_areas.shp + -io.out model.txt + -sample.vfn Class + -classifier sharkkm + -classifier.sharkkm.k 4 + +If your training samples are in a vector data file, you can use the application +*TrainVectorClassifier*. In this case, you don't need a fake label field. You +just need to specify which fields shall be used to do the training. + +:: + + otbcli_TrainVectorClassifier + -io.vd training_samples.shp + -io.out model.txt + -feat perimeter area width red nir + -classifier sharkkm + -classifier.sharkkm.k 4 + +Once you have the model file, the actual classification step is the same as +the supervised case. The model will predict labels on your input data. + +:: + + otbcli_ImageClassifier + -in input_image.tif + -model model.txt + -out kmeans_labels.tif Fusion of classification maps ----------------------------- diff --git a/Documentation/Latex/listings.sty b/Documentation/Latex/listings.sty deleted file mode 100644 index 08c19ceb95917e0ffdf47549827e3ce27497def4..0000000000000000000000000000000000000000 --- a/Documentation/Latex/listings.sty +++ /dev/null @@ -1,2237 +0,0 @@ -%% -%% This is file `listings.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% listings.dtx (with options: `kernel') -%% -%% Please read the software license in listings-1.3.dtx or listings-1.3.pdf. -%% -%% (w)(c) 1996--2004 Carsten Heinz and/or any other author listed -%% elsewhere in this file. -%% (c) 2006 Brooks Moses -%% -%% Send comments and ideas on the package, error reports and additional -%% programming languages to <bmoses@dpdx.net>. -%% -\def\filedate{2007/02/22} -\def\fileversion{1.4} -\NeedsTeXFormat{LaTeX2e} -\AtEndOfPackage{\ProvidesPackage{listings} - [\filedate\space\fileversion\space(Carsten Heinz)]} -\def\lst@CheckVersion#1{\edef\reserved@a{#1}% - \ifx\lst@version\reserved@a \expandafter\@gobble - \else \expandafter\@firstofone \fi} -\let\lst@version\fileversion -\def\lst@InputCatcodes{% - \makeatletter \catcode`\"12% - \catcode`\^^@\active - \catcode`\^^I9% - \catcode`\^^L9% - \catcode`\^^M9% - \catcode`\%14% - \catcode`\~\active} -\def\lst@RestoreCatcodes#1{% - \ifx\relax#1\else - \noexpand\catcode`\noexpand#1\the\catcode`#1\relax - \expandafter\lst@RestoreCatcodes - \fi} -\edef\lst@RestoreCatcodes{% - \noexpand\lccode`\noexpand\/`\noexpand\/% - \lst@RestoreCatcodes\"\^^I\^^M\~\^^@\relax - \catcode12\active} -\lst@InputCatcodes -\AtEndOfPackage{\lst@RestoreCatcodes} -\def\@lst{lst} -\def\lst@IfSubstring#1#2{% - \def\lst@temp##1#1##2##3\relax{% - \ifx \@empty##2\expandafter\@secondoftwo - \else \expandafter\@firstoftwo \fi}% - \expandafter\lst@temp#2#1\@empty\relax} -\def\lst@IfOneOf#1\relax#2{% - \def\lst@temp##1,#1,##2##3\relax{% - \ifx \@empty##2\expandafter\@secondoftwo - \else \expandafter\@firstoftwo \fi}% - \expandafter\lst@temp\expandafter,#2,#1,\@empty\relax} -\def\lst@DeleteKeysIn#1#2{% - \expandafter\lst@DeleteKeysIn@\expandafter#1#2,\relax,} -\def\lst@DeleteKeysIn@#1#2,{% - \ifx\relax#2\@empty - \expandafter\@firstoftwo\expandafter\lst@RemoveCommas - \else - \ifx\@empty#2\@empty\else - \def\lst@temp##1,#2,##2{% - ##1% - \ifx\@empty##2\@empty\else - \expandafter\lst@temp\expandafter,% - \fi ##2}% - \edef#1{\expandafter\lst@temp\expandafter,#1,#2,\@empty}% - \fi - \fi - \lst@DeleteKeysIn@#1} -\def\lst@RemoveCommas#1{\edef#1{\expandafter\lst@RC@#1\@empty}} -\def\lst@RC@#1{\ifx,#1\expandafter\lst@RC@ \else #1\fi} -\def\lst@ReplaceIn#1#2{% - \expandafter\lst@ReplaceIn@\expandafter#1#2\@empty\@empty} -\def\lst@ReplaceInArg#1#2{\lst@ReplaceIn@#1#2\@empty\@empty} -\def\lst@ReplaceIn@#1#2#3{% - \ifx\@empty#3\relax\else - \def\lst@temp##1#2##2{% - \ifx\@empty##2% - \lst@lAddTo#1{##1}% - \else - \lst@lAddTo#1{##1#3}\expandafter\lst@temp - \fi ##2}% - \let\@tempa#1\let#1\@empty - \expandafter\lst@temp\@tempa#2\@empty - \expandafter\lst@ReplaceIn@\expandafter#1% - \fi} -\providecommand*\@gobblethree[3]{} -\def\lst@GobbleNil#1\@nil{} -\def\lst@Swap#1#2{#2#1} -\def\lst@true{\let\lst@if\iftrue} -\def\lst@false{\let\lst@if\iffalse} -\lst@false -\def\lst@IfNextCharsArg#1{% - \def\lst@tofind{#1}\lst@IfNextChars\lst@tofind} -\def\lst@IfNextChars#1#2#3{% - \let\lst@tofind#1\def\@tempa{#2}\def\@tempb{#3}% - \let\lst@eaten\@empty \lst@IfNextChars@} -\def\lst@IfNextChars@{\expandafter\lst@IfNextChars@@\lst@tofind\relax} -\def\lst@IfNextChars@@#1#2\relax#3{% - \def\lst@tofind{#2}\lst@lAddTo\lst@eaten{#3}% - \ifx#1#3% - \ifx\lst@tofind\@empty - \let\lst@next\@tempa - \else - \let\lst@next\lst@IfNextChars@ - \fi - \expandafter\lst@next - \else - \expandafter\@tempb - \fi} -\def\lst@IfNextCharActive#1#2#3{% - \begingroup \lccode`\~=`#3\lowercase{\endgroup - \ifx~}#3% - \def\lst@next{#1}% - \else - \def\lst@next{#2}% - \fi \lst@next #3} -\def\lst@for#1\do#2{% - \def\lst@forbody##1{#2}% - \def\@tempa{#1}% - \ifx\@tempa\@empty\else\expandafter\lst@f@r#1,\@nil,\fi -} -\def\lst@f@r#1,{% - \def\@tempa{#1}% - \ifx\@tempa\@nnil\else\lst@forbody{#1}\expandafter\lst@f@r\fi -} -\def\lst@MakeActive#1{% - \let\lst@temp\@empty \lst@MakeActive@#1% - \relax\relax\relax\relax\relax\relax\relax\relax\relax} -\begingroup -\catcode`\^^@=\active \catcode`\^^A=\active \catcode`\^^B=\active -\catcode`\^^C=\active \catcode`\^^D=\active \catcode`\^^E=\active -\catcode`\^^F=\active \catcode`\^^G=\active \catcode`\^^H=\active -\gdef\lst@MakeActive@#1#2#3#4#5#6#7#8#9{\let\lst@next\relax - \ifx#1\relax - \else \lccode`\^^@=`#1% - \ifx#2\relax - \lowercase{\lst@lAddTo\lst@temp{^^@}}% - \else \lccode`\^^A=`#2% - \ifx#3\relax - \lowercase{\lst@lAddTo\lst@temp{^^@^^A}}% - \else \lccode`\^^B=`#3% - \ifx#4\relax - \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B}}% - \else \lccode`\^^C=`#4% - \ifx#5\relax - \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C}}% - \else \lccode`\^^D=`#5% - \ifx#6\relax - \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D}}% - \else \lccode`\^^E=`#6% - \ifx#7\relax - \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E}}% - \else \lccode`\^^F=`#7% - \ifx#8\relax - \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F}}% - \else \lccode`\^^G=`#8% - \ifx#9\relax - \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F^^G}}% - \else \lccode`\^^H=`#9% - \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F^^G^^H}}% - \let\lst@next\lst@MakeActive@ - \fi \fi \fi \fi \fi \fi \fi \fi \fi - \lst@next} -\endgroup -\def\lst@DefActive#1#2{\lst@MakeActive{#2}\let#1\lst@temp} -\def\lst@DefOther#1#2{% - \begingroup \def#1{#2}\escapechar\m@ne \expandafter\endgroup - \expandafter\lst@DefOther@\meaning#1\relax#1} -\def\lst@DefOther@#1>#2\relax#3{\edef#3{\zap@space#2 \@empty}} -\def\lst@InsideConvert#1{% - \lst@ifmathescape - \lst@InsideConvert@e#1$\@nil - \lst@if - \lst@InsideConvert@ey#1\@nil - \else - \lst@InsideConvert@#1 \@empty - \expandafter\@gobbletwo - \fi - \expandafter\lst@next - \else - \lst@InsideConvert@#1 \@empty - \fi} -\begingroup \lccode`\~=`\ \relax \lowercase{% -\gdef\lst@InsideConvert@#1 #2{% - \lst@MakeActive{#1}% - \ifx\@empty#2% - \lst@lExtend\lst@arg{\lst@temp}% - \else - \lst@lExtend\lst@arg{\lst@temp~}% - \expandafter\lst@InsideConvert@ - \fi #2} -}\endgroup -\def\lst@InsideConvert@e#1$#2\@nil{% - \ifx\@empty#2\@empty \lst@false \else \lst@true \fi} -\def\lst@InsideConvert@ey#1$#2$#3\@nil{% - \lst@InsideConvert@#1 \@empty - \lst@lAddTo\lst@arg{% - \lst@ifdropinput\else - \lst@TrackNewLines\lst@OutputLostSpace \lst@XPrintToken - \setbox\@tempboxa=\hbox\bgroup$\lst@escapebegin - #2% - \lst@escapeend$\egroup \lst@CalcLostSpaceAndOutput - \lst@whitespacefalse - \fi}% - \def\lst@next{\lst@InsideConvert{#3}}% -} -\def\lst@XConvert{\@ifnextchar\bgroup \lst@XConvertArg\lst@XConvert@} -\def\lst@XConvertArg#1{% - {\lst@false \let\lst@arg\@empty - \lst@XConvert#1\@nil - \global\let\@gtempa\lst@arg}% - \lst@lExtend\lst@arg{\expandafter{\@gtempa}}% - \lst@XConvertNext} -\def\lst@XConvert@#1{% - \ifx\@nil#1\else - \begingroup\lccode`\~=`#1\lowercase{\endgroup - \lst@lAddTo\lst@arg~}% - \expandafter\lst@XConvertNext - \fi} -\def\lst@XConvertNext{% - \lst@if \expandafter\lst@XConvertX - \else \expandafter\lst@XConvert \fi} -\def\lst@XConvertX#1{% - \ifx\@nil#1\else - \lst@XConvertX@#1\relax - \expandafter\lst@XConvert - \fi} -\def\lst@XConvertX@#1#2\relax{% - \begingroup\lccode`\~=`#1\lowercase{\endgroup - \lst@XCConvertX@@~}{#2}} -\def\lst@XCConvertX@@#1#2{\lst@lAddTo\lst@arg{{#1#2}}} -\def\lst@Require#1#2#3#4#5{% - \begingroup - \aftergroup\lst@true - \ifx\@empty#3\@empty\else - \def\lst@prefix{#2}\let\lst@require\@empty - \edef\lst@temp{\expandafter\zap@space#3 \@empty}% - \lst@for\lst@temp\do{% - \ifx\@empty##1\@empty\else \lstKV@OptArg[]{##1}{% - #4[####1]{####2}% - \@ifundefined{\@lst\lst@prefix @\lst@malias $\lst@oalias}% - {\edef\lst@require{\lst@require,\lst@malias $\lst@oalias}}% - {}}% - \fi}% - \global\let\lst@loadaspects\@empty - \lst@InputCatcodes - \ifx\lst@require\@empty\else - \lst@for{#5}\do{% - \ifx\lst@require\@empty\else - \InputIfFileExists{##1}{}{}% - \fi}% - \fi - \ifx\lst@require\@empty\else - \PackageError{Listings}{Couldn't load requested #1}% - {The following #1s weren't loadable:^^J\@spaces - \lst@require^^JThis may cause errors in the sequel.}% - \aftergroup\lst@false - \fi - \ifx\lst@loadaspects\@empty\else - \lst@RequireAspects\lst@loadaspects - \fi - \fi - \endgroup} -\def\lst@IfRequired[#1]#2{% - \lst@NormedDef\lst@temp{[#1]#2}% - \expandafter\lst@IfRequired@\lst@temp\relax} -\def\lst@IfRequired@[#1]#2\relax#3{% - \lst@IfOneOf #2$#1\relax\lst@require - {\lst@DeleteKeysIn@\lst@require#2$#1,\relax,% - \global\expandafter\let - \csname\@lst\lst@prefix @#2$#1\endcsname\@empty - #3}} -\let\lst@require\@empty -\def\lst@NoAlias[#1]#2{% - \lst@NormedDef\lst@oalias{#1}\lst@NormedDef\lst@malias{#2}} -\gdef\lst@LAS#1#2#3#4#5#6#7{% - \lst@Require{#1}{#2}{#3}#4#5% - #4#3% - \@ifundefined{lst#2@\lst@malias$\lst@oalias}% - {\PackageError{Listings}% - {#1 \ifx\@empty\lst@oalias\else \lst@oalias\space of \fi - \lst@malias\space undefined}% - {The #1 is not loadable. \@ehc}}% - {#6\csname\@lst#2@\lst@malias $\lst@oalias\endcsname #7}} -\def\lst@RequireAspects#1{% - \lst@Require{aspect}{asp}{#1}\lst@NoAlias\lstaspectfiles} -\let\lstloadaspects\lst@RequireAspects -\@ifundefined{lstaspectfiles} - {\newcommand\lstaspectfiles{lstmisc0.sty,lstmisc.sty}}{} -\gdef\lst@DefDriver#1#2#3#4{% - \@ifnextchar[{\lst@DefDriver@{#1}{#2}#3#4}% - {\lst@DefDriver@{#1}{#2}#3#4[]}} -\gdef\lst@DefDriver@#1#2#3#4[#5]#6{% - \def\lst@name{#1}\let\lst@if#4% - \lst@NormedDef\lst@driver{\@lst#2@#6$#5}% - \lst@IfRequired[#5]{#6}{\begingroup \lst@true}% - {\begingroup}% - \lst@setcatcodes - \@ifnextchar[{\lst@XDefDriver{#1}#3}{\lst@DefDriver@@#3}} -\gdef\lst@DefDriver@@#1#2{% - \lst@if - \global\@namedef{\lst@driver}{#1{#2}}% - \fi - \endgroup - \@ifnextchar[\lst@XXDefDriver\@empty} -\gdef\lst@XXDefDriver[#1]{% - \ifx\@empty#1\@empty\else - \lst@if - \lstloadaspects{#1}% - \else - \@ifundefined{\lst@driver}{}% - {\xdef\lst@loadaspects{\lst@loadaspects,#1}}% - \fi - \fi} -\gdef\lst@XDefDriver#1#2[#3]#4#5{\lst@DefDriver@@#2{also#1=[#3]#4,#5}} -\let\lst@UserCommand\gdef -\newcommand*\lst@BeginAspect[2][]{% - \def\lst@curraspect{#2}% - \ifx \lst@curraspect\@empty - \expandafter\lst@GobbleAspect - \else - \let\lst@next\@empty - \lst@IfRequired[]{#2}% - {\lst@RequireAspects{#1}% - \lst@if\else \let\lst@next\lst@GobbleAspect \fi}% - {\let\lst@next\lst@GobbleAspect}% - \expandafter\lst@next - \fi} -\def\lst@EndAspect{% - \csname\@lst patch@\lst@curraspect\endcsname - \let\lst@curraspect\@empty} -\long\def\lst@GobbleAspect#1\lst@EndAspect{\let\lst@curraspect\@empty} -\def\lst@Key#1#2{% - \@ifnextchar[{\lstKV@def{#1}{#2}}% - {\def\lst@temp{\lst@Key@{#1}{#2}} - \afterassignment\lst@temp - \global\@namedef{KV@\@lst @#1}####1}} -\def\lstKV@def#1#2[#3]{% - \global\@namedef{KV@\@lst @#1@default\expandafter}\expandafter - {\csname KV@\@lst @#1\endcsname{#3}}% - \def\lst@temp{\lst@Key@{#1}{#2}}\afterassignment\lst@temp - \global\@namedef{KV@\@lst @#1}##1} -\def\lst@Key@#1#2{% - \ifx\relax#2\@empty\else - \begingroup \globaldefs\@ne - \csname KV@\@lst @#1\endcsname{#2}% - \endgroup - \fi} -\def\lst@UseHook#1{\csname\@lst hk@#1\endcsname} -\def\lst@AddToHook{\lst@ATH@\iffalse\lst@AddTo} -\def\lst@AddToHookExe{\lst@ATH@\iftrue\lst@AddTo} -\def\lst@AddToHookAtTop{\lst@ATH@\iffalse\lst@AddToAtTop} -\long\def\lst@ATH@#1#2#3#4{% - \@ifundefined{\@lst hk@#3}{% - \expandafter\gdef\csname\@lst hk@#3\endcsname{}}{}% - \expandafter#2\csname\@lst hk@#3\endcsname{#4}% - \def\lst@temp{#4}% - #1% \iftrue|false - \begingroup \globaldefs\@ne \lst@temp \endgroup - \fi} -\long\def\lst@AddTo#1#2{% - \expandafter\gdef\expandafter#1\expandafter{#1#2}} -\def\lst@AddToAtTop#1#2{\def\lst@temp{#2}% - \expandafter\expandafter\expandafter\gdef - \expandafter\expandafter\expandafter#1% - \expandafter\expandafter\expandafter{\expandafter\lst@temp#1}} -\def\lst@lAddTo#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} -\def\lst@Extend#1#2{% - \expandafter\lst@AddTo\expandafter#1\expandafter{#2}} -\def\lst@lExtend#1#2{% - \expandafter\lst@lAddTo\expandafter#1\expandafter{#2}} -\RequirePackage{keyval}[1997/11/10] -\def\lstKV@TwoArg#1#2{\gdef\@gtempa##1##2{#2}\@gtempa#1{}{}} -\def\lstKV@ThreeArg#1#2{\gdef\@gtempa##1##2##3{#2}\@gtempa#1{}{}{}} -\def\lstKV@FourArg#1#2{\gdef\@gtempa##1##2##3##4{#2}\@gtempa#1{}{}{}{}} -\def\lstKV@OptArg[#1]#2#3{% - \gdef\@gtempa[##1]##2{#3}\lstKV@OptArg@{#1}#2\@} -\def\lstKV@OptArg@#1{\@ifnextchar[\lstKV@OptArg@@{\lstKV@OptArg@@[#1]}} -\def\lstKV@OptArg@@[#1]#2\@{\@gtempa[#1]{#2}} -\def\lstKV@XOptArg[#1]#2#3{% - \global\let\@gtempa#3\lstKV@OptArg@{#1}#2\@} -\def\lstKV@CSTwoArg#1#2{% - \gdef\@gtempa##1,##2,##3\relax{#2}% - \@gtempa#1,,\relax} -\def\lstKV@SetIf#1{\lstKV@SetIf@#1\relax} -\def\lstKV@SetIf@#1#2\relax#3{\lowercase{% - \expandafter\let\expandafter#3% - \csname if\ifx #1t}true\else false\fi\endcsname} -\def\lstKV@SwitchCases#1#2#3{% - \def\lst@temp##1\\#1&##2\\##3##4\@nil{% - \ifx\@empty##3% - #3% - \else - ##2% - \fi - }% - \lst@temp\\#2\\#1&\\\@empty\@nil} -\lst@UserCommand\lstset{\begingroup \lst@setcatcodes \lstset@} -\def\lstset@#1{\endgroup \ifx\@empty#1\@empty\else\setkeys{lst}{#1}\fi} -\def\lst@setcatcodes{\makeatletter \catcode`\==12\relax} -\def\lst@NewMode#1{% - \ifx\@undefined#1% - \lst@mode\lst@newmode\relax \advance\lst@mode\@ne - \xdef\lst@newmode{\the\lst@mode}% - \global\chardef#1=\lst@mode - \lst@mode\lst@nomode - \fi} -\newcount\lst@mode -\def\lst@newmode{\m@ne}% init -\lst@NewMode\lst@nomode % init (of \lst@mode :-) -\def\lst@UseDynamicMode{% - \@tempcnta\lst@dynamicmode\relax \advance\@tempcnta\@ne - \edef\lst@dynamicmode{\the\@tempcnta}% - \expandafter\lst@Swap\expandafter{\expandafter{\lst@dynamicmode}}} -\lst@AddToHook{InitVars}{\let\lst@dynamicmode\lst@newmode} -\def\lst@EnterMode#1#2{% - \bgroup \lst@mode=#1\relax #2% - \lst@FontAdjust - \lst@lAddTo\lst@entermodes{\lst@EnterMode{#1}{#2}}} -\lst@AddToHook{InitVars}{\let\lst@entermodes\@empty} -\let\lst@entermodes\@empty % init -\def\lst@LeaveMode{% - \ifnum\lst@mode=\lst@nomode\else - \egroup \expandafter\lsthk@EndGroup - \fi} -\lst@AddToHook{EndGroup}{}% init -\def\lst@InterruptModes{% - \lst@Extend\lst@modestack{\expandafter{\lst@entermodes}}% - \lst@LeaveAllModes} -\lst@AddToHook{InitVars}{\global\let\lst@modestack\@empty} -\def\lst@ReenterModes{% - \ifx\lst@modestack\@empty\else - \lst@LeaveAllModes - \global\let\@gtempa\lst@modestack - \global\let\lst@modestack\@empty - \expandafter\lst@ReenterModes@\@gtempa\relax - \fi} -\def\lst@ReenterModes@#1#2{% - \ifx\relax#2\@empty - \gdef\@gtempa##1{#1}% - \expandafter\@gtempa - \else - \lst@AddTo\lst@modestack{{#1}}% - \expandafter\lst@ReenterModes@ - \fi - {#2}} -\def\lst@LeaveAllModes{% - \ifnum\lst@mode=\lst@nomode - \expandafter\lsthk@EndGroup - \else - \expandafter\egroup\expandafter\lst@LeaveAllModes - \fi} -\lst@AddToHook{ExitVars}{\lst@LeaveAllModes} -\lst@NewMode\lst@Pmode -\lst@NewMode\lst@GPmode -\def\lst@modetrue{\let\lst@ifmode\iftrue \lsthk@ModeTrue} -\let\lst@ifmode\iffalse % init -\lst@AddToHook{ModeTrue}{}% init -\def\lst@Lmodetrue{\let\lst@ifLmode\iftrue} -\let\lst@ifLmode\iffalse % init -\lst@AddToHook{EOL}{\@whilesw \lst@ifLmode\fi \lst@LeaveMode} -\def\lst@NormedDef#1#2{\lowercase{\edef#1{\zap@space#2 \@empty}}} -\def\lst@NormedNameDef#1#2{% - \lowercase{\edef\lst@temp{\zap@space#1 \@empty}% - \expandafter\xdef\csname\lst@temp\endcsname{\zap@space#2 \@empty}}} -\def\lst@GetFreeMacro#1{% - \@tempcnta\z@ \def\lst@freemacro{#1\the\@tempcnta}% - \lst@GFM@} -\def\lst@GFM@{% - \expandafter\ifx \csname\lst@freemacro\endcsname \relax - \edef\lst@freemacro{\csname\lst@freemacro\endcsname}% - \else - \advance\@tempcnta\@ne - \expandafter\lst@GFM@ - \fi} -\newbox\lst@gtempboxa -\newtoks\lst@token \newcount\lst@length -\def\lst@ResetToken{\lst@token{}\lst@length\z@} -\lst@AddToHook{InitVarsBOL}{\lst@ResetToken \let\lst@lastother\@empty} -\lst@AddToHook{EndGroup}{\lst@ResetToken \let\lst@lastother\@empty} -\def\lst@lettertrue{\let\lst@ifletter\iftrue} -\def\lst@letterfalse{\let\lst@ifletter\iffalse} -\lst@AddToHook{InitVars}{\lst@letterfalse} -\def\lst@Append#1{\advance\lst@length\@ne - \lst@token=\expandafter{\the\lst@token#1}} -\def\lst@AppendOther{% - \lst@ifletter \lst@Output\lst@letterfalse \fi - \futurelet\lst@lastother\lst@Append} -\def\lst@AppendLetter{% - \lst@ifletter\else \lst@OutputOther\lst@lettertrue \fi - \lst@Append} -\def\lst@SaveToken{% - \global\let\lst@gthestyle\lst@thestyle - \global\let\lst@glastother\lst@lastother - \xdef\lst@RestoreToken{\noexpand\lst@token{\the\lst@token}% - \noexpand\lst@length\the\lst@length\relax - \noexpand\let\noexpand\lst@thestyle - \noexpand\lst@gthestyle - \noexpand\let\noexpand\lst@lastother - \noexpand\lst@glastother}} -\def\lst@IfLastOtherOneOf#1{\lst@IfLastOtherOneOf@ #1\relax} -\def\lst@IfLastOtherOneOf@#1{% - \ifx #1\relax - \expandafter\@secondoftwo - \else - \ifx\lst@lastother#1% - \lst@IfLastOtherOneOf@t - \else - \expandafter\expandafter\expandafter\lst@IfLastOtherOneOf@ - \fi - \fi} -\def\lst@IfLastOtherOneOf@t#1\fi\fi#2\relax{\fi\fi\@firstoftwo} -\newdimen\lst@currlwidth % \global -\newcount\lst@column \newcount\lst@pos % \global -\lst@AddToHook{InitVarsBOL} - {\global\lst@currlwidth\z@ \global\lst@pos\z@ \global\lst@column\z@} -\def\lst@CalcColumn{% - \@tempcnta\lst@column - \advance\@tempcnta\lst@length - \advance\@tempcnta-\lst@pos} -\newdimen\lst@lostspace % \global -\lst@AddToHook{InitVarsBOL}{\global\lst@lostspace\z@} -\def\lst@UseLostSpace{\ifdim\lst@lostspace>\z@ \lst@InsertLostSpace \fi} -\def\lst@InsertLostSpace{% - \lst@Kern\lst@lostspace \global\lst@lostspace\z@} -\def\lst@InsertHalfLostSpace{% - \global\lst@lostspace.5\lst@lostspace \lst@Kern\lst@lostspace} -\newdimen\lst@width -\lst@Key{basewidth}{0.6em,0.45em}{\lstKV@CSTwoArg{#1}% - {\def\lst@widthfixed{##1}\def\lst@widthflexible{##2}% - \ifx\lst@widthflexible\@empty - \let\lst@widthflexible\lst@widthfixed - \fi - \def\lst@temp{\PackageError{Listings}% - {Negative value(s) treated as zero}% - \@ehc}% - \let\lst@error\@empty - \ifdim \lst@widthfixed<\z@ - \let\lst@error\lst@temp \let\lst@widthfixed\z@ - \fi - \ifdim \lst@widthflexible<\z@ - \let\lst@error\lst@temp \let\lst@widthflexible\z@ - \fi - \lst@error}} -\lst@AddToHook{FontAdjust} - {\lst@width=\lst@ifflexible\lst@widthflexible - \else\lst@widthfixed\fi \relax} -\lst@Key{fontadjust}{false}[t]{\lstKV@SetIf{#1}\lst@iffontadjust} -\def\lst@FontAdjust{\lst@iffontadjust \lsthk@FontAdjust \fi} -\lst@AddToHook{InitVars}{\lsthk@FontAdjust} -\def\lst@OutputBox#1{\lst@alloverstyle{\box#1}} -\def\lst@alloverstyle#1{#1}% init -\def\lst@Kern#1{% - \setbox\z@\hbox{{\lst@currstyle{\kern#1}}}% - \global\advance\lst@currlwidth \wd\z@ - \lst@OutputBox\z@} -\def\lst@CalcLostSpaceAndOutput{% - \global\advance\lst@lostspace \lst@length\lst@width - \global\advance\lst@lostspace-\wd\@tempboxa - \global\advance\lst@currlwidth \wd\@tempboxa - \global\advance\lst@pos -\lst@length - \setbox\@tempboxa\hbox{\let\lst@OutputBox\box - \ifdim\lst@lostspace>\z@ \lst@leftinsert \fi - \box\@tempboxa - \ifdim\lst@lostspace>\z@ \lst@rightinsert \fi}% - \lst@OutputBox\@tempboxa \lsthk@PostOutput} -\lst@AddToHook{PostOutput}{}% init -\def\lst@OutputToken{% - \lst@TrackNewLines \lst@OutputLostSpace - \lst@ifgobbledws - \lst@gobbledwhitespacefalse - \lst@@discretionary - \fi - \lst@CheckMerge - {\lst@thestyle{\lst@FontAdjust - \setbox\@tempboxa\lst@hbox - {\lsthk@OutputBox - \lst@lefthss - \expandafter\lst@FillOutputBox\the\lst@token\@empty - \lst@righthss}% - \lst@CalcLostSpaceAndOutput}}% - \lst@ResetToken} -\lst@AddToHook{OutputBox}{}% init -\def\lst@gobbledwhitespacetrue{\global\let\lst@ifgobbledws\iftrue} -\def\lst@gobbledwhitespacefalse{\global\let\lst@ifgobbledws\iffalse} -\lst@AddToHookExe{InitBOL}{\lst@gobbledwhitespacefalse}% init -\def\lst@Delay#1{% - \lst@CheckDelay - #1% - \lst@GetOutputMacro\lst@delayedoutput - \edef\lst@delayed{\the\lst@token}% - \edef\lst@delayedlength{\the\lst@length}% - \lst@ResetToken} -\def\lst@Merge#1{% - \lst@CheckMerge - #1% - \edef\lst@merged{\the\lst@token}% - \edef\lst@mergedlength{\the\lst@length}% - \lst@ResetToken} -\def\lst@MergeToken#1#2{% - \advance\lst@length#2% - \lst@lExtend#1{\the\lst@token}% - \expandafter\lst@token\expandafter{#1}% - \let#1\@empty} -\def\lst@CheckDelay{% - \ifx\lst@delayed\@empty\else - \lst@GetOutputMacro\@gtempa - \ifx\lst@delayedoutput\@gtempa - \lst@MergeToken\lst@delayed\lst@delayedlength - \else - {\lst@ResetToken - \lst@MergeToken\lst@delayed\lst@delayedlength - \lst@delayedoutput}% - \let\lst@delayed\@empty - \fi - \fi} -\def\lst@CheckMerge{% - \ifx\lst@merged\@empty\else - \lst@MergeToken\lst@merged\lst@mergedlength - \fi} -\let\lst@delayed\@empty % init -\let\lst@merged\@empty % init -\def\lst@column@fixed{% - \lst@flexiblefalse - \lst@width\lst@widthfixed\relax - \let\lst@OutputLostSpace\lst@UseLostSpace - \let\lst@FillOutputBox\lst@FillFixed - \let\lst@hss\hss - \def\lst@hbox{\hbox to\lst@length\lst@width}} -\def\lst@FillFixed#1{#1\lst@FillFixed@} -\def\lst@FillFixed@#1{% - \ifx\@empty#1\else \lst@hss#1\expandafter\lst@FillFixed@ \fi} -\def\lst@column@flexible{% - \lst@flexibletrue - \lst@width\lst@widthflexible\relax - \let\lst@OutputLostSpace\lst@UseLostSpace - \let\lst@FillOutputBox\@empty - \let\lst@hss\@empty - \let\lst@hbox\hbox} -\def\lst@column@fullflexible{% - \lst@column@flexible - \def\lst@OutputLostSpace{\lst@ifnewline \lst@UseLostSpace\fi}% - \let\lst@leftinsert\@empty - \let\lst@rightinsert\@empty} -\def\lst@column@spaceflexible{% - \lst@column@flexible - \def\lst@OutputLostSpace{% - \lst@ifwhitespace - \ifx\lst@outputspace\lst@visiblespace - \else - \lst@UseLostSpace - \fi - \else - \lst@ifnewline \lst@UseLostSpace\fi - \fi}% - \let\lst@leftinsert\@empty - \let\lst@rightinsert\@empty} -\def\lst@outputpos#1#2\relax{% - \def\lst@lefthss{\lst@hss}\let\lst@righthss\lst@lefthss - \let\lst@rightinsert\lst@InsertLostSpace - \ifx #1c% - \let\lst@leftinsert\lst@InsertHalfLostSpace - \else\ifx #1r% - \let\lst@righthss\@empty - \let\lst@leftinsert\lst@InsertLostSpace - \let\lst@rightinsert\@empty - \else - \let\lst@lefthss\@empty - \let\lst@leftinsert\@empty - \ifx #1l\else \PackageWarning{Listings}% - {Unknown positioning for output boxes}% - \fi - \fi\fi} -\def\lst@flexibletrue{\let\lst@ifflexible\iftrue} -\def\lst@flexiblefalse{\let\lst@ifflexible\iffalse} -\lst@Key{columns}{[c]fixed}{\lstKV@OptArg[]{#1}{% - \ifx\@empty##1\@empty\else \lst@outputpos##1\relax\relax \fi - \expandafter\let\expandafter\lst@arg - \csname\@lst @column@##2\endcsname - \lst@arg - \ifx\lst@arg\relax - \PackageWarning{Listings}{Unknown column format `##2'}% - \else - \lst@ifflexible - \let\lst@columnsflexible\lst@arg - \else - \let\lst@columnsfixed\lst@arg - \fi - \fi}} -\let\lst@columnsfixed\lst@column@fixed % init -\let\lst@columnsflexible\lst@column@flexible % init -\lst@Key{flexiblecolumns}\relax[t]{% - \lstKV@SetIf{#1}\lst@ifflexible - \lst@ifflexible \lst@columnsflexible - \else \lst@columnsfixed \fi} -\newcount\lst@newlines -\lst@AddToHook{InitVars}{\global\lst@newlines\z@} -\lst@AddToHook{InitVarsBOL}{\global\advance\lst@newlines\@ne} -\def\lst@NewLine{% - \ifx\lst@OutputBox\@gobble\else - \par\noindent \hbox{}% - \fi - \global\advance\lst@newlines\m@ne - \lst@newlinetrue} -\def\lst@newlinetrue{\global\let\lst@ifnewline\iftrue} -\lst@AddToHookExe{PostOutput}{\global\let\lst@ifnewline\iffalse}% init -\def\lst@TrackNewLines{% - \ifnum\lst@newlines>\z@ - \lsthk@OnNewLine - \lst@DoNewLines - \fi} -\lst@AddToHook{OnNewLine}{}% init -\lst@Key{emptylines}\maxdimen{% - \@ifstar{\lst@true\@tempcnta\@gobble#1\relax\lst@GobbleNil}% - {\lst@false\@tempcnta#1\relax\lst@GobbleNil}#1\@nil - \advance\@tempcnta\@ne - \edef\lst@maxempty{\the\@tempcnta\relax}% - \let\lst@ifpreservenumber\lst@if} -\def\lst@DoNewLines{ - \@whilenum\lst@newlines>\lst@maxempty \do - {\lst@ifpreservenumber - \lsthk@OnEmptyLine - \global\advance\c@lstnumber\lst@advancelstnum - \fi - \global\advance\lst@newlines\m@ne}% - \@whilenum \lst@newlines>\@ne \do - {\lsthk@OnEmptyLine \lst@NewLine}% - \ifnum\lst@newlines>\z@ \lst@NewLine \fi} -\lst@AddToHook{OnEmptyLine}{}% init -\lst@Key{identifierstyle}{}{\def\lst@identifierstyle{#1}} -\lst@AddToHook{EmptyStyle}{\let\lst@identifierstyle\@empty} -\def\lst@GotoTabStop{% - \ifnum\lst@newlines=\z@ - \setbox\@tempboxa\hbox{\lst@outputspace}% - \setbox\@tempboxa\hbox to\wd\@tempboxa{{\lst@currstyle{\hss}}}% - \lst@CalcLostSpaceAndOutput - \else - \global\advance\lst@lostspace \lst@length\lst@width - \global\advance\lst@column\lst@length \lst@length\z@ - \fi} -\def\lst@OutputOther{% - \lst@CheckDelay - \ifnum\lst@length=\z@\else - \let\lst@thestyle\lst@currstyle - \lsthk@OutputOther - \lst@OutputToken - \fi} -\lst@AddToHook{OutputOther}{}% init -\let\lst@currstyle\relax % init -\def\lst@Output{% - \lst@CheckDelay - \ifnum\lst@length=\z@\else - \ifx\lst@currstyle\relax - \let\lst@thestyle\lst@identifierstyle - \else - \let\lst@thestyle\lst@currstyle - \fi - \lsthk@Output - \lst@OutputToken - \fi - \let\lst@lastother\relax} -\lst@AddToHook{Output}{}% init -\def\lst@GetOutputMacro#1{% - \lst@ifletter \global\let#1\lst@Output - \else \global\let#1\lst@OutputOther\fi} -\def\lst@PrintToken{% - \lst@ifletter \lst@Output \lst@letterfalse - \else \lst@OutputOther \let\lst@lastother\@empty \fi} -\def\lst@XPrintToken{% - \lst@PrintToken \lst@CheckMerge - \ifnum\lst@length=\z@\else \lst@PrintToken \fi} -\def\lst@BeginDropOutput#1{% - \xdef\lst@BDOnewlines{\the\lst@newlines}% - \global\let\lst@BDOifnewline\lst@ifnewline - \lst@EnterMode{#1}% - {\lst@modetrue - \let\lst@OutputBox\@gobble - \aftergroup\lst@BDORestore}} -\def\lst@BDORestore{% - \global\lst@newlines\lst@BDOnewlines - \global\let\lst@ifnewline\lst@BDOifnewline} -\let\lst@EndDropOutput\lst@LeaveMode -\def\lst@ProcessLetter{\lst@whitespacefalse \lst@AppendLetter} -\def\lst@ProcessOther{\lst@whitespacefalse \lst@AppendOther} -\def\lst@ProcessDigit{% - \lst@whitespacefalse - \lst@ifletter \expandafter\lst@AppendLetter - \else \expandafter\lst@AppendOther\fi} -\def\lst@whitespacetrue{\global\let\lst@ifwhitespace\iftrue} -\def\lst@whitespacefalse{\global\let\lst@ifwhitespace\iffalse} -\lst@AddToHook{InitVarsBOL}{\lst@whitespacetrue} -\lst@Key{tabsize}{8} - {\ifnum#1>\z@ \def\lst@tabsize{#1}\else - \PackageError{Listings}{Strict positive integer expected}% - {You can't use `#1' as tabsize. \@ehc}% - \fi} -\lst@Key{showtabs}f[t]{\lstKV@SetIf{#1}\lst@ifshowtabs} -\lst@Key{tab}{\kern.06em\hbox{\vrule\@height.3ex}% - \hrulefill\hbox{\vrule\@height.3ex}} - {\def\lst@tab{#1}} -\def\lst@ProcessTabulator{% - \lst@XPrintToken \lst@whitespacetrue - \global\advance\lst@column -\lst@pos - \@whilenum \lst@pos<\@ne \do - {\global\advance\lst@pos\lst@tabsize}% - \lst@length\lst@pos - \lst@PreGotoTabStop} -\def\lst@PreGotoTabStop{% - \lst@ifshowtabs - \lst@TrackNewLines - \setbox\@tempboxa\hbox to\lst@length\lst@width - {{\lst@currstyle{\hss\lst@tab}}}% - \lst@CalcLostSpaceAndOutput - \else - \lst@ifkeepspaces - \@tempcnta\lst@length \lst@length\z@ - \@whilenum \@tempcnta>\z@ \do - {\lst@AppendOther\lst@outputspace - \advance\@tempcnta\m@ne}% - \lst@OutputOther - \else - \lst@GotoTabStop - \fi - \fi - \lst@length\z@ \global\lst@pos\z@} -\def\lst@outputspace{\ } -\def\lst@visiblespace{\lst@ttfamily{\char32}\textvisiblespace} -\lst@Key{showspaces}{false}[t]{\lstKV@SetIf{#1}\lst@ifshowspaces} -\lst@Key{keepspaces}{false}[t]{\lstKV@SetIf{#1}\lst@ifkeepspaces} -\lst@AddToHook{Init} - {\lst@ifshowspaces - \let\lst@outputspace\lst@visiblespace - \lst@keepspacestrue - \fi} -\def\lst@keepspacestrue{\let\lst@ifkeepspaces\iftrue} -\def\lst@ProcessSpace{% - \lst@ifkeepspaces - \lst@PrintToken - \lst@whitespacetrue - \lst@AppendOther\lst@outputspace - \lst@PrintToken - \else \ifnum\lst@newlines=\z@ - \lst@AppendSpecialSpace - \else \ifnum\lst@length=\z@ - \global\advance\lst@lostspace\lst@width - \global\advance\lst@pos\m@ne - \lst@whitespacetrue - \else - \lst@AppendSpecialSpace - \fi - \fi \fi} -\def\lst@AppendSpecialSpace{% - \lst@ifwhitespace - \lst@PrintToken - \global\advance\lst@lostspace\lst@width - \global\advance\lst@pos\m@ne - \lst@gobbledwhitespacetrue - \else - \lst@PrintToken - \lst@whitespacetrue - \lst@AppendOther\lst@outputspace - \lst@PrintToken - \fi} -\lst@Key{formfeed}{\bigbreak}{\def\lst@formfeed{#1}} -\def\lst@ProcessFormFeed{% - \lst@XPrintToken - \ifnum\lst@newlines=\z@ - \lst@EOLUpdate \lsthk@InitVarsBOL - \fi - \lst@formfeed - \lst@whitespacetrue} -\def\lst@Def#1{\lccode`\~=#1\lowercase{\def~}} -\def\lst@Let#1{\lccode`\~=#1\lowercase{\let~}} -\lst@AddToAtTop{\try@load@fontshape}{\def\space{ }} -\def\lst@SelectStdCharTable{% - \lst@Def{9}{\lst@ProcessTabulator}% - \lst@Def{12}{\lst@ProcessFormFeed}% - \lst@Def{32}{\lst@ProcessSpace}} -\def\lst@CCPut#1#2{% - \ifnum#2=\z@ - \expandafter\@gobbletwo - \else - \lccode`\~=#2\lccode`\/=#2\lowercase{\lst@CCPut@~{#1/}}% - \fi - \lst@CCPut#1} -\def\lst@CCPut@#1#2{\lst@lAddTo\lst@SelectStdCharTable{\def#1{#2}}} -\lst@CCPut \lst@ProcessOther - {"21}{"22}{"28}{"29}{"2B}{"2C}{"2E}{"2F} - {"3A}{"3B}{"3D}{"3F}{"5B}{"5D} - \z@ -\lst@CCPut \lst@ProcessDigit - {"30}{"31}{"32}{"33}{"34}{"35}{"36}{"37}{"38}{"39} - \z@ -\lst@CCPut \lst@ProcessLetter - {"40}{"41}{"42}{"43}{"44}{"45}{"46}{"47} - {"48}{"49}{"4A}{"4B}{"4C}{"4D}{"4E}{"4F} - {"50}{"51}{"52}{"53}{"54}{"55}{"56}{"57} - {"58}{"59}{"5A} - {"61}{"62}{"63}{"64}{"65}{"66}{"67} - {"68}{"69}{"6A}{"6B}{"6C}{"6D}{"6E}{"6F} - {"70}{"71}{"72}{"73}{"74}{"75}{"76}{"77} - {"78}{"79}{"7A} - \z@ -\def\lst@CCPutMacro#1#2#3{% - \ifnum#2=\z@ \else - \begingroup\lccode`\~=#2\relax \lccode`\/=#2\relax - \lowercase{\endgroup\expandafter\lst@CCPutMacro@ - \csname\@lst @um/\expandafter\endcsname - \csname\@lst @um/@\endcsname /~}#1{#3}% - \expandafter\lst@CCPutMacro - \fi} -\def\lst@CCPutMacro@#1#2#3#4#5#6{% - \lst@lAddTo\lst@SelectStdCharTable{\def#4{#5#1}}% - \def#1{\lst@UM#3}% - \def#2{#6}} -\def\lst@UM#1{\csname\@lst @um#1@\endcsname} -\lst@CCPutMacro - \lst@ProcessOther {"23}\# - \lst@ProcessLetter{"24}\textdollar - \lst@ProcessOther {"25}\% - \lst@ProcessOther {"26}\& - \lst@ProcessOther {"27}{\lst@ifupquote \textquotesingle - \else \char39\relax \fi} - \lst@ProcessOther {"2A}{\lst@ttfamily*\textasteriskcentered} - \lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{$-$}} - \lst@ProcessOther {"3C}{\lst@ttfamily<\textless} - \lst@ProcessOther {"3E}{\lst@ttfamily>\textgreater} - \lst@ProcessOther {"5C}{\lst@ttfamily{\char92}\textbackslash} - \lst@ProcessOther {"5E}\textasciicircum - \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}\textunderscore} - \lst@ProcessOther {"60}{\lst@ifupquote \textasciigrave - \else \char96\relax \fi} - \lst@ProcessOther {"7B}{\lst@ttfamily{\char123}\textbraceleft} - \lst@ProcessOther {"7C}{\lst@ttfamily|\textbar} - \lst@ProcessOther {"7D}{\lst@ttfamily{\char125}\textbraceright} - \lst@ProcessOther {"7E}\textasciitilde - \lst@ProcessOther {"7F}- - \@empty\z@\@empty -\def\lst@ttfamily#1#2{\ifx\f@family\ttdefault#1\relax\else#2\fi} -\lst@AddToHook{Init}{\edef\ttdefault{\ttdefault}} -\lst@Key{upquote}{false}[t]{\lstKV@SetIf{#1}\lst@ifupquote - \lst@ifupquote - \@ifundefined{textasciigrave}% - {\let\KV@lst@upquote\@gobble - \lstKV@SetIf f\lst@ifupquote \@gobble\fi - \PackageError{Listings}{Option `upquote' requires `textcomp' - package.\MessageBreak The option has been disabled}% - {Add \string\usepackage{textcomp} to your preamble.}}% - {}% - \fi} -\AtBeginDocument{% - \@ifpackageloaded{upquote}{\RequirePackage{textcomp}% - \lstset{upquote}}{}% - \@ifpackageloaded{upquote2}{\lstset{upquote}}{}} -\def\lst@activecharstrue{\let\lst@ifactivechars\iftrue} -\def\lst@activecharsfalse{\let\lst@ifactivechars\iffalse} -\lst@activecharstrue -\def\lst@SelectCharTable{% - \lst@SelectStdCharTable - \lst@ifactivechars - \catcode9\active \catcode12\active \catcode13\active - \@tempcnta=32\relax - \@whilenum\@tempcnta<128\do - {\catcode\@tempcnta\active\advance\@tempcnta\@ne}% - \fi - \lst@ifec \lst@DefEC \fi - \let\do\lst@do@noligs \verbatim@nolig@list - \lsthk@SelectCharTable - \lst@DeveloperSCT -\lst@DefRange - \ifx\lst@Backslash\relax\else - \lst@LetSaveDef{"5C}\lsts@backslash\lst@Backslash - \fi} -\lst@Key{SelectCharTable}{}{\def\lst@DeveloperSCT{#1}} -\lst@Key{MoreSelectCharTable}\relax{\lst@lAddTo\lst@DeveloperSCT{#1}} -\lst@AddToHook{SetLanguage}{\let\lst@DeveloperSCT\@empty} -\def\lst@do@noligs#1{% - \begingroup \lccode`\~=`#1\lowercase{\endgroup - \lst@do@noligs@~}} -\def\lst@do@noligs@#1{% - \expandafter\expandafter\expandafter\def - \expandafter\expandafter\expandafter#1% - \expandafter\expandafter\expandafter{\expandafter\lst@NoLig#1}} -\def\lst@NoLig{\advance\lst@length\m@ne \lst@Append\lst@nolig} -\def\lst@nolig{\lst@UM\@empty}% -\@namedef{\@lst @um@}{\leavevmode\kern\z@} -\def\lst@SaveOutputDef#1#2{% - \begingroup \lccode`\~=#1\relax \lowercase{\endgroup - \def\lst@temp##1\def~##2##3\relax}{% - \global\expandafter\let\expandafter#2\@gobble##2\relax}% - \expandafter\lst@temp\lst@SelectStdCharTable\relax} -\lst@SaveOutputDef{"5C}\lstum@backslash -\lst@Key{extendedchars}{true}[t]{\lstKV@SetIf{#1}\lst@ifec} -\def\lst@DefEC{% - \lst@CCECUse \lst@ProcessLetter - ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f% - ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f% - ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af% - ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf% - ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf% - ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df% - ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef% - ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff% - ^^00} -\def\lst@CCECUse#1#2{% - \ifnum`#2=\z@ - \expandafter\@gobbletwo - \else - \ifnum\catcode`#2=\active - \lccode`\~=`#2\lccode`\/=`#2\lowercase{\lst@CCECUse@#1~/}% - \else - \lst@ifactivechars \catcode`#2=\active \fi - \lccode`\~=`#2\lccode`\/=`#2\lowercase{\def~{#1/}}% - \fi - \fi - \lst@CCECUse#1} -\def\lst@CCECUse@#1#2#3{% - \expandafter\def\csname\@lst @EC#3\endcsname{\lst@UM#3}% - \expandafter\let\csname\@lst @um#3@\endcsname #2% - \edef#2{\noexpand#1% - \expandafter\noexpand\csname\@lst @EC#3\endcsname}} -\lst@AddToHook{Init} - {\let\lsts@nfss@catcodes\nfss@catcodes - \let\nfss@catcodes\lst@nfss@catcodes} -\def\lst@nfss@catcodes{% - \lst@makeletter - ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\relax - \@makeother (\@makeother )\@makeother ,\@makeother :\@makeother\&% - \@makeother 0\@makeother 1\@makeother 2\@makeother 3\@makeother 4% - \@makeother 5\@makeother 6\@makeother 7\@makeother 8\@makeother 9% - \@makeother =\lsts@nfss@catcodes} -\def\lst@makeletter#1{% - \ifx\relax#1\else\catcode`#111\relax \expandafter\lst@makeletter\fi} -\lst@Key{useoutput}{2}{\edef\lst@useoutput{\ifcase0#1 0\or 1\else 2\fi}} -\lst@AddToHook{Init} -{\edef\lst@OrgOutput{\the\output}% -\ifcase\lst@useoutput\relax -\or - \output{\global\setbox\lst@gtempboxa\box\@cclv - \expandafter\egroup - \lst@SaveToken - \lst@InterruptModes - \setbox\@cclv\box\lst@gtempboxa - \bgroup\lst@OrgOutput\egroup - \bgroup - \aftergroup\pagegoal\aftergroup\vsize - \aftergroup\lst@ReenterModes\aftergroup\lst@RestoreToken}% -\else - \output{\lst@RestoreOrigCatcodes - \lst@ifec \lst@RestoreOrigExtendedCatcodes \fi - \lst@OrgOutput}% -\fi} -\def\lst@GetChars#1#2#3{% - \let#1\@empty - \@tempcnta#2\relax \@tempcntb#3\relax - \loop \ifnum\@tempcnta<\@tempcntb\relax - \lst@lExtend#1{\expandafter\catcode\the\@tempcnta=}% - \lst@lExtend#1{\the\catcode\@tempcnta\relax}% - \ifnum\the\catcode\@tempcnta=\active - \begingroup\lccode`\~=\@tempcnta - \lowercase{\endgroup - \lst@lExtend#1{\expandafter\let\expandafter~\csname - lstecs@\the\@tempcnta\endcsname}% - \expandafter\let\csname lstecs@\the\@tempcnta\endcsname~}% - \fi - \advance\@tempcnta\@ne - \repeat} -\begingroup \catcode12=\active\let^^L\@empty -\gdef\lst@ScanChars{% - \let\lsts@ssL^^L% - \def^^L{\par}% - \lst@GetChars\lst@RestoreOrigCatcodes\@ne {128}% - \let^^L\lsts@ssL - \lst@GetChars\lst@RestoreOrigExtendedCatcodes{128}{256}} -\endgroup -\lst@Key{rescanchars}\relax{\lst@ScanChars} -\AtBeginDocument{\lst@ScanChars} -\lst@Key{alsoletter}\relax{% - \lst@DoAlso{#1}\lst@alsoletter\lst@ProcessLetter} -\lst@Key{alsodigit}\relax{% - \lst@DoAlso{#1}\lst@alsodigit\lst@ProcessDigit} -\lst@Key{alsoother}\relax{% - \lst@DoAlso{#1}\lst@alsoother\lst@ProcessOther} -\lst@AddToHook{SelectCharTable} - {\lst@alsoother \lst@alsodigit \lst@alsoletter} -\lst@AddToHookExe{SetLanguage}% init - {\let\lst@alsoletter\@empty - \let\lst@alsodigit\@empty - \let\lst@alsoother\@empty} -\def\lst@DoAlso#1#2#3{% - \lst@DefOther\lst@arg{#1}\let#2\@empty - \expandafter\lst@DoAlso@\expandafter#2\expandafter#3\lst@arg\relax} -\def\lst@DoAlso@#1#2#3{% - \ifx\relax#3\expandafter\@gobblethree \else - \begingroup \lccode`\~=`#3\relax \lowercase{\endgroup - \def\lst@temp##1\def~##2##3\relax{% - \edef\lst@arg{\def\noexpand~{\noexpand#2\expandafter - \noexpand\@gobble##2}}}}% - \expandafter\lst@temp\lst@SelectStdCharTable\relax - \lst@lExtend#1{\lst@arg}% - \fi - \lst@DoAlso@#1#2} -\def\lst@SaveDef#1#2{% - \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~}} -\def\lst@DefSaveDef#1#2{% - \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~\def~}} -\def\lst@LetSaveDef#1#2{% - \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~\let~}} -\def\lst@CDef#1{\lst@CDef@#1} -\def\lst@CDef@#1#2#3#4{\lst@CDefIt#1{#2}{#3}{#4#2#3}#4} -\def\lst@CDefX#1{\lst@CDefX@#1} -\def\lst@CDefX@#1#2#3{\lst@CDefIt#1{#2}{#3}{}} -\def\lst@CDefIt#1#2#3#4#5#6#7#8{% - \ifx\@empty#2\@empty - \def#1{#6\def\lst@next{#7#4#8}\lst@next}% - \else \ifx\@empty#3\@empty - \def#1##1{% - #6% - \ifx##1#2\def\lst@next{#7#4#8}\else - \def\lst@next{#5##1}\fi - \lst@next}% - \else - \def#1{% - #6% - \lst@IfNextCharsArg{#2#3}{#7#4#8}% - {\expandafter#5\lst@eaten}}% - \fi \fi} -\def\lst@CArgX#1#2\relax{% - \lst@DefActive\lst@arg{#1#2}% - \expandafter\lst@CArg\lst@arg\relax} -\def\lst@CArg#1#2\relax{% - \lccode`\/=`#1\lowercase{\def\lst@temp{/}}% - \lst@GetFreeMacro{lst@c\lst@temp}% - \expandafter\lst@CArg@\lst@freemacro#1#2\@empty\@empty\relax} -\def\lst@CArg@#1#2#3#4\@empty#5\relax#6{% - \let#1#2% - \ifx\@empty#3\@empty - \def\lst@next{#6{#2{}{}}}% - \else - \def\lst@next{#6{#2#3{#4}}}% - \fi - \lst@next #1} -\def\lst@CArgEmpty#1\@empty{#1} -\lst@Key{excludedelims}\relax - {\lsthk@ExcludeDelims \lst@NormedDef\lst@temp{#1}% - \expandafter\lst@for\lst@temp\do - {\expandafter\let\csname\@lst @ifex##1\endcsname\iftrue}} -\def\lst@DelimPrint#1#2{% - #1% - \begingroup - \lst@mode\lst@nomode \lst@modetrue - #2\lst@XPrintToken - \endgroup - \lst@ResetToken - \fi} -\def\lst@DelimOpen#1#2#3#4#5#6\@empty{% - \lst@TrackNewLines \lst@XPrintToken - \lst@DelimPrint#1{#6}% - \lst@EnterMode{#4}{\def\lst@currstyle#5}% - \lst@DelimPrint{#1#2}{#6}% - #3} -\def\lst@DelimClose#1#2#3\@empty{% - \lst@TrackNewLines \lst@XPrintToken - \lst@DelimPrint{#1#2}{#3}% - \lst@LeaveMode - \lst@DelimPrint{#1}{#3}} -\def\lst@BeginDelim{\lst@DelimOpen\iffalse\else{}} -\def\lst@EndDelim{\lst@DelimClose\iffalse\else} -\def\lst@BeginIDelim{\lst@DelimOpen\iffalse{}{}} -\def\lst@EndIDelim{\lst@DelimClose\iffalse{}} -\lst@AddToHook{SelectCharTable}{\lst@DefDelims} -\lst@AddToHookExe{SetLanguage}{\let\lst@DefDelims\@empty} -\def\lst@Delim#1{% - \lst@false \let\lst@cumulative\@empty \let\lst@arg\@empty - \@ifstar{\@ifstar{\lst@Delim@{#1}}% - {\let\lst@cumulative\relax - \lst@Delim@{#1}}}% - {\lst@true\lst@Delim@{#1}}} -\def\lst@Delim@#1[#2]{% - \gdef\lst@delimtype{#2}% - \@ifnextchar[\lst@Delim@sty - {\lst@Delim@sty[#1]}} -\def\lst@Delim@sty[#1]{% - \def\lst@delimstyle{#1}% - \ifx\@empty#1\@empty\else - \lst@Delim@sty@ #1\@nil - \fi - \@ifnextchar[\lst@Delim@option - \lst@Delim@delim} -\def\lst@Delim@option[#1]{\def\lst@arg{[#1]}\lst@Delim@delim} -\def\lst@Delim@sty@#1#2\@nil{% - \if\relax\noexpand#1\else - \edef\lst@delimstyle{\expandafter\noexpand - \csname\@lst @\lst@delimstyle\endcsname}% - \fi} -\def\lst@Delim@delim#1\relax#2#3#4#5#6#7#8{% - \ifx #4\@empty \lst@Delim@delall{#2}\fi - \ifx\@empty#1\@empty - \ifx #4\@nil - \@ifundefined{\@lst @#2DM@\lst@delimtype}% - {\lst@Delim@delall{#2@\lst@delimtype}}% - {\lst@Delim@delall{#2DM@\lst@delimtype}}% - \fi - \else - \expandafter\lst@Delim@args\expandafter - {\lst@delimtype}{#1}{#5}#6{#7}{#8}#4% - \let\lst@delim\@empty - \expandafter\lst@IfOneOf\lst@delimtype\relax#3% - {\@ifundefined{\@lst @#2DM@\lst@delimtype}% - {\lst@lExtend\lst@delim{\csname\@lst @#2@\lst@delimtype - \expandafter\endcsname\lst@arg}}% - {\lst@lExtend\lst@delim{\expandafter\lst@UseDynamicMode - \csname\@lst @#2DM@\lst@delimtype - \expandafter\endcsname\lst@arg}}% - \ifx #4\@nil - \let\lst@temp\lst@DefDelims \let\lst@DefDelims\@empty - \expandafter\lst@Delim@del\lst@temp\@empty\@nil\@nil\@nil - \else - \lst@lExtend\lst@DefDelims\lst@delim - \fi}% - {\PackageError{Listings}{Illegal type `\lst@delimtype'}% - {#2 types are #3.}}% - \fi} -\def\lst@Delim@args#1#2#3#4#5#6#7{% - \begingroup - \lst@false \let\lst@next\lst@XConvert - \@ifnextchar #4{\xdef\lst@delimtype{\expandafter\@gobble - \lst@delimtype}% - #5\lst@next#2\@nil - \lst@lAddTo\lst@arg{\@empty#6}% - \lst@GobbleNil}% - {\lst@next#2\@nil - \lst@lAddTo\lst@arg{\@empty#3}% - \lst@GobbleNil}% - #1\@nil - \global\let\@gtempa\lst@arg - \endgroup - \let\lst@arg\@gtempa - \ifx #7\@nil\else - \expandafter\lst@Delim@args@\expandafter{\lst@delimstyle}% - \fi} -\def\lst@Delim@args@#1{% - \lst@if - \lst@lAddTo\lst@arg{{{#1}\lst@modetrue}}% - \else - \ifx\lst@cumulative\@empty - \lst@lAddTo\lst@arg{{{}#1}}% - \else - \lst@lAddTo\lst@arg{{{#1}}}% - \fi - \fi} -\def\lst@Delim@del#1\@empty#2#3#4{% - \ifx #2\@nil\else - \def\lst@temp{#1\@empty#2#3}% - \ifx\lst@temp\lst@delim\else - \lst@lAddTo\lst@DefDelims{#1\@empty#2#3{#4}}% - \fi - \expandafter\lst@Delim@del - \fi} -\def\lst@Delim@delall#1{% - \begingroup - \edef\lst@delim{\expandafter\string\csname\@lst @#1\endcsname}% - \lst@false \global\let\@gtempa\@empty - \expandafter\lst@Delim@delall@\lst@DefDelims\@empty - \endgroup - \let\lst@DefDelims\@gtempa} -\def\lst@Delim@delall@#1{% - \ifx #1\@empty\else - \ifx #1\lst@UseDynamicMode - \lst@true - \let\lst@next\lst@Delim@delall@do - \else - \def\lst@next{\lst@Delim@delall@do#1}% - \fi - \expandafter\lst@next - \fi} -\def\lst@Delim@delall@do#1#2\@empty#3#4#5{% - \expandafter\lst@IfSubstring\expandafter{\lst@delim}{\string#1}% - {}% - {\lst@if \lst@AddTo\@gtempa\lst@UseDynamicMode \fi - \lst@AddTo\@gtempa{#1#2\@empty#3#4{#5}}}% - \lst@false \lst@Delim@delall@} -\gdef\lst@DefDelimB#1#2#3#4#5#6#7#8{% - \lst@CDef{#1}#2% - {#3}% - {\let\lst@bnext\lst@CArgEmpty - \lst@ifmode #4\else - #5% - \def\lst@bnext{#6{#7}{#8}}% - \fi - \lst@bnext}% - \@empty} -\gdef\lst@DefDelimE#1#2#3#4#5#6#7{% - \lst@CDef{#1}#2% - {#3}% - {\let\lst@enext\lst@CArgEmpty - \ifnum #7=\lst@mode% - #4% - \let\lst@enext#6% - \else - #5% - \fi - \lst@enext}% - \@empty} -\lst@AddToHook{Init}{\let\lst@bnext\relax \let\lst@enext\relax} -\gdef\lst@DefDelimBE#1#2#3#4#5#6#7#8#9{% - \lst@CDef{#1}#2% - {#3}% - {\let\lst@bnext\lst@CArgEmpty - \ifnum #7=\lst@mode - #4% - \let\lst@bnext#9% - \else - \lst@ifmode\else - #5% - \def\lst@bnext{#6{#7}{#8}}% - \fi - \fi - \lst@bnext}% - \@empty} -\gdef\lst@delimtypes{s,l} -\gdef\lst@DelimKey#1#2{% - \lst@Delim{}#2\relax - {Delim}\lst@delimtypes #1% - {\lst@BeginDelim\lst@EndDelim} - i\@empty{\lst@BeginIDelim\lst@EndIDelim}} -\lst@Key{delim}\relax{\lst@DelimKey\@empty{#1}} -\lst@Key{moredelim}\relax{\lst@DelimKey\relax{#1}} -\lst@Key{deletedelim}\relax{\lst@DelimKey\@nil{#1}} -\gdef\lst@DelimDM@l#1#2\@empty#3#4#5{% - \lst@CArg #2\relax\lst@DefDelimB{}{}{}#3{#1}{#5\lst@Lmodetrue}} -\gdef\lst@DelimDM@s#1#2#3\@empty#4#5#6{% - \lst@CArg #2\relax\lst@DefDelimB{}{}{}#4{#1}{#6}% - \lst@CArg #3\relax\lst@DefDelimE{}{}{}#5{#1}} -\def\lst@ReplaceInput#1{\lst@CArgX #1\relax\lst@CDefX{}{}} -\def\lst@Literatekey#1\@nil@{\let\lst@ifxliterate\lst@if - \def\lst@literate{#1}} -\lst@Key{literate}{}{\@ifstar{\lst@true \lst@Literatekey} - {\lst@false\lst@Literatekey}#1\@nil@} -\lst@AddToHook{SelectCharTable} - {\ifx\lst@literate\@empty\else - \expandafter\lst@Literate\lst@literate{}\relax\z@ - \fi} -\def\lst@Literate#1#2#3{% - \ifx\relax#2\@empty\else - \lst@CArgX #1\relax\lst@CDef - {} - {\let\lst@next\@empty - \lst@ifxliterate - \lst@ifmode \let\lst@next\lst@CArgEmpty \fi - \fi - \ifx\lst@next\@empty - \ifx\lst@OutputBox\@gobble\else - \lst@XPrintToken \let\lst@scanmode\lst@scan@m - \lst@token{#2}\lst@length#3\relax - \lst@XPrintToken - \fi - \let\lst@next\lst@CArgEmptyGobble - \fi - \lst@next}% - \@empty - \expandafter\lst@Literate - \fi} -\def\lst@CArgEmptyGobble#1\@empty{} -\def\lst@BeginDropInput#1{% - \lst@EnterMode{#1}% - {\lst@modetrue - \let\lst@OutputBox\@gobble - \let\lst@ifdropinput\iftrue - \let\lst@ProcessLetter\@gobble - \let\lst@ProcessDigit\@gobble - \let\lst@ProcessOther\@gobble - \let\lst@ProcessSpace\@empty - \let\lst@ProcessTabulator\@empty - \let\lst@ProcessFormFeed\@empty}} -\let\lst@ifdropinput\iffalse % init -\lst@Key{basicstyle}\relax{\def\lst@basicstyle{#1}} -\lst@Key{inputencoding}\relax{\def\lst@inputenc{#1}} -\lst@AddToHook{Init} - {\lst@basicstyle - \ifx\lst@inputenc\@empty\else - \@ifundefined{inputencoding}{}% - {\inputencoding\lst@inputenc}% - \fi} -\lst@AddToHookExe{EmptyStyle} - {\let\lst@basicstyle\@empty - \let\lst@inputenc\@empty} -\lst@Key{multicols}{}{\@tempcnta=0#1\relax\def\lst@multicols{#1}} -\def\lst@parshape{\parshape\@ne \z@ \linewidth} -\lst@AddToHookAtTop{EveryLine}{\lst@parshape} -\lst@AddToHookAtTop{EndGroup}{\lst@parshape} -\newcount\lst@lineno % \global -\lst@AddToHook{InitVars}{\global\lst@lineno\@ne} -\lst@Key{print}{true}[t]{\lstKV@SetIf{#1}\lst@ifprint} -\lst@Key{firstline}\relax{\def\lst@firstline{#1\relax}} -\lst@Key{lastline}\relax{\def\lst@lastline{#1\relax}} -\lst@AddToHook{PreSet} - {\let\lst@firstline\@ne \def\lst@lastline{9999999\relax}} -\lst@Key{linerange}\relax{\lstKV@OptArg[]{#1}{% - \def\lst@interrange{##1}\def\lst@linerange{##2,}}} -\lst@Key{rangeprefix}\relax{\def\lst@rangebeginprefix{#1}% - \def\lst@rangeendprefix{#1}} -\lst@Key{rangesuffix}\relax{\def\lst@rangebeginsuffix{#1}% - \def\lst@rangeendsuffix{#1}} -\lst@Key{rangebeginprefix}{}{\def\lst@rangebeginprefix{#1}} -\lst@Key{rangebeginsuffix}{}{\def\lst@rangebeginsuffix{#1}} -\lst@Key{rangeendprefix}{}{\def\lst@rangeendprefix{#1}} -\lst@Key{rangeendsuffix}{}{\def\lst@rangeendsuffix{#1}} -\lst@Key{includerangemarker}{true}[t]{\lstKV@SetIf{#1}\lst@ifincluderangemarker} -\lst@AddToHook{PreSet}{\def\lst@firstline{1\relax}% - \let\lst@linerange\@empty} -\lst@AddToHook{Init} -{\ifx\lst@linerange\@empty - \edef\lst@linerange{{\lst@firstline}-{\lst@lastline},}% - \fi - \lst@GetLineInterval}% -\def\lst@GetLineInterval{\expandafter\lst@GLI\lst@linerange\@nil} -\def\lst@GLI#1,#2\@nil{\def\lst@linerange{#2}\lst@GLI@#1--\@nil} -\def\lst@GLI@#1-#2-#3\@nil{% - \lst@IfNumber{#1}% - {\ifx\@empty#1\@empty - \let\lst@firstline\@ne - \else - \def\lst@firstline{#1\relax}% - \fi - \ifx\@empty#3\@empty - \def\lst@lastline{9999999\relax}% - \else - \ifx\@empty#2\@empty - \let\lst@lastline\lst@firstline - \else - \def\lst@lastline{#2\relax}% - \fi - \fi}% - {\def\lst@firstline{9999999\relax}% - \let\lst@lastline\lst@firstline - \let\lst@rangebegin\lst@rangebeginprefix - \lst@AddTo\lst@rangebegin{#1}\lst@Extend\lst@rangebegin\lst@rangebeginsuffix - \ifx\@empty#3\@empty - \let\lst@rangeend\lst@rangeendprefix - \lst@AddTo\lst@rangeend{#1}\lst@Extend\lst@rangeend\lst@rangeendsuffix - \else - \ifx\@empty#2\@empty - \let\lst@rangeend\@empty - \else - \let\lst@rangeend\lst@rangeendprefix - \lst@AddTo\lst@rangeend{#2}\lst@Extend\lst@rangeend\lst@rangeendsuffix - \fi - \fi - \global\def\lst@DefRange{\expandafter\lst@CArgX\lst@rangebegin\relax\lst@DefRangeB}% - \ifnum\lst@mode=\lst@Pmode \expandafter\lst@DefRange \fi}} -\lst@AddToHookExe{DeInit}{\global\let\lst@DefRange\@empty} -\def\lst@DefRangeB#1#2{\lst@DefRangeB@#1#2} -\def\lst@DefRangeB@#1#2#3#4{% - \lst@CDef{#1{#2}{#3}}#4{}% - {\lst@ifincluderangemarker - \lst@LeaveMode - \let#1#4% - \lst@DefRangeEnd - \lst@InitLstNumber - \else - \@tempcnta\lst@lineno \advance\@tempcnta\@ne - \edef\lst@firstline{\the\@tempcnta\relax}% - \gdef\lst@OnceAtEOL{\let#1#4\lst@DefRangeEnd}% - \lst@InitLstNumber - \fi - \global\let\lst@DefRange\lst@DefRangeEnd - \lst@CArgEmpty}% - \@empty} -\def\lstpatch@labels{% -\gdef\lst@SetFirstNumber{% - \ifx\lst@firstnumber\@undefined - \@tempcnta 0\csname\@lst no@\lst@intname\endcsname\relax - \ifnum\@tempcnta=\z@ \else - \lst@nololtrue - \advance\@tempcnta\lst@advancenumber - \edef\lst@firstnumber{\the\@tempcnta\relax}% - \fi - \fi}% -} -\def\lst@InitLstNumber{% - \global\c@lstnumber\lst@firstnumber - \global\advance\c@lstnumber\lst@advancenumber - \global\advance\c@lstnumber-\lst@advancelstnum - \ifx \lst@firstnumber\c@lstnumber - \global\advance\c@lstnumber-\lst@advancelstnum - \fi} -\def\lst@DefRangeEnd{% - \ifx\lst@rangeend\@empty\else - \expandafter\lst@CArgX\lst@rangeend\relax\lst@DefRangeE - \fi} -\def\lst@DefRangeE#1#2{\lst@DefRangeE@#1#2} -\def\lst@DefRangeE@#1#2#3#4{% - \lst@CDef{#1#2{#3}}#4{}% - {\let#1#4% - \edef\lst@lastline{\the\lst@lineno\relax}% - \lst@DefRangeE@@}% - \@empty} -\def\lst@DefRangeE@@#1\@empty{% - \lst@ifincluderangemarker - #1\lst@XPrintToken - \fi - \lst@LeaveModeToPmode - \lst@BeginDropInput{\lst@Pmode}} -\def\lst@LeaveModeToPmode{% - \ifnum\lst@mode=\lst@Pmode - \expandafter\lsthk@EndGroup - \else - \expandafter\egroup\expandafter\lst@LeaveModeToPmode - \fi} -\lst@AddToHook{EOL}{\lst@OnceAtEOL\global\let\lst@OnceAtEOL\@empty} -\gdef\lst@OnceAtEOL{}% Init -\def\lst@MSkipToFirst{% - \global\advance\lst@lineno\@ne - \ifnum \lst@lineno=\lst@firstline - \def\lst@next{\lst@LeaveMode \global\lst@newlines\z@ - \lst@OnceAtEOL \global\let\lst@OnceAtEOL\@empty - \lst@InitLstNumber % Added to work with modified \lsthk@PreInit. - \lsthk@InitVarsBOL - \lst@BOLGobble}% - \expandafter\lst@next - \fi} -\def\lst@SkipToFirst{% - \ifnum \lst@lineno<\lst@firstline - \def\lst@next{\lst@BeginDropInput\lst@Pmode - \lst@Let{13}\lst@MSkipToFirst - \lst@Let{10}\lst@MSkipToFirst}% - \expandafter\lst@next - \else - \expandafter\lst@BOLGobble - \fi} -\def\lst@IfNumber#1{% - \ifx\@empty#1\@empty - \let\lst@next\@firstoftwo - \else - \lst@IfNumber@#1\@nil - \fi - \lst@next} -\def\lst@IfNumber@#1#2\@nil{% - \let\lst@next\@secondoftwo - \ifnum`#1>47\relax \ifnum`#1>57\relax\else - \let\lst@next\@firstoftwo - \fi\fi} -\lst@Key{nolol}{false}[t]{\lstKV@SetIf{#1}\lst@ifnolol} -\def\lst@nololtrue{\let\lst@ifnolol\iftrue} -\let\lst@ifnolol\iffalse % init -\lst@Key{captionpos}{t}{\def\lst@captionpos{#1}} -\lst@Key{abovecaptionskip}\smallskipamount{\def\lst@abovecaption{#1}} -\lst@Key{belowcaptionskip}\smallskipamount{\def\lst@belowcaption{#1}} -\lst@Key{label}\relax{\def\lst@label{#1}} -\lst@Key{title}\relax{\def\lst@title{#1}\let\lst@caption\relax} -\lst@Key{caption}\relax{\lstKV@OptArg[{#1}]{#1}% - {\def\lst@caption{##2}\def\lst@@caption{##1}}% - \let\lst@title\@empty} -\lst@AddToHookExe{TextStyle} - {\let\lst@caption\@empty \let\lst@@caption\@empty - \let\lst@title\@empty \let\lst@label\@empty} -\AtBeginDocument{ - \@ifundefined{thechapter}{\let\lst@ifnumberbychapter\iffalse}{} - \lst@ifnumberbychapter - \newcounter{lstlisting}[chapter] - \gdef\thelstlisting% - {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@lstlisting} - \else - \newcounter{lstlisting} - \gdef\thelstlisting{\@arabic\c@lstlisting} - \fi} -\lst@UserCommand\lstlistingname{Listing} -\lst@Key{numberbychapter}{true}[t]{\lstKV@SetIf{#1}\lst@ifnumberbychapter} -\@ifundefined{abovecaptionskip} -{\newskip\abovecaptionskip - \newskip\belowcaptionskip}{} -\@ifundefined{@makecaption} -{\long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{#1: #2}% - \ifdim \wd\@tempboxa >\hsize - #1: #2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip}% -}{} -\def\fnum@lstlisting{% - \lstlistingname - \ifx\lst@@caption\@empty\else~\thelstlisting\fi}% -\def\lst@MakeCaption#1{% - \lst@ifdisplaystyle - \ifx #1t% - \ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else - \expandafter\refstepcounter - \fi {lstlisting}% - \ifx\lst@label\@empty\else \label{\lst@label}\fi - \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl - \global\let\lst@name\lst@arg \global\let\lstname\lst@name - \lst@ifnolol\else - \ifx\lst@@caption\@empty - \ifx\lst@caption\@empty - \ifx\lst@intname\@empty \else \def\lst@temp{ }% - \ifx\lst@intname\lst@temp \else - \addcontentsline{lol}{lstlisting}\lst@name - \fi\fi - \fi - \else - \addcontentsline{lol}{lstlisting}% - {\protect\numberline{\thelstlisting}\lst@@caption}% - \fi - \fi - \fi - \ifx\lst@caption\@empty\else - \lst@IfSubstring #1\lst@captionpos - {\begingroup \let\@@vskip\vskip - \def\vskip{\afterassignment\lst@vskip \@tempskipa}% - \def\lst@vskip{\nobreak\@@vskip\@tempskipa\nobreak}% - \par\@parboxrestore\normalsize\normalfont % \noindent (AS) - \ifx #1t\allowbreak \fi - \ifx\lst@title\@empty - \lst@makecaption\fnum@lstlisting{\ignorespaces \lst@caption} - \else - \lst@maketitle\lst@title % (AS) - \fi - \ifx #1b\allowbreak \fi - \endgroup}{}% - \fi - \fi} -\def\lst@makecaption{\@makecaption} -\def\lst@maketitle{\@makecaption\lst@title@dropdelim} -\def\lst@title@dropdelim#1{\ignorespaces} -\AtBeginDocument{% -\@ifundefined{captionlabelfalse}{}{% - \def\lst@maketitle{\captionlabelfalse\@makecaption\@empty}}% -\@ifundefined{caption@startrue}{}{% - \def\lst@maketitle{\caption@startrue\@makecaption\@empty}}% -} -\def\lst@HRefStepCounter#1{% - \begingroup - \c@lstlisting\lst@neglisting - \advance\c@lstlisting\m@ne \xdef\lst@neglisting{\the\c@lstlisting}% - \ifx\hyper@refstepcounter\@undefined\else - \hyper@refstepcounter{#1}% - \fi - \endgroup} -\gdef\lst@neglisting{\z@}% init -\lst@Key{boxpos}{c}{\def\lst@boxpos{#1}} -\def\lst@boxtrue{\let\lst@ifbox\iftrue} -\let\lst@ifbox\iffalse -\lst@Key{float}\relax[\lst@floatplacement]{% - \lstKV@SwitchCases{#1}% - {true&\let\lst@floatdefault\lst@floatplacement - \let\lst@float\lst@floatdefault\\% - false&\let\lst@floatdefault\relax - \let\lst@float\lst@floatdefault - }{\def\lst@next{\@ifstar{\let\lst@beginfloat\@dblfloat - \let\lst@endfloat\end@dblfloat - \lst@KFloat}% - {\let\lst@beginfloat\@float - \let\lst@endfloat\end@float - \lst@KFloat}} - \edef\lst@float{#1}% - \expandafter\lst@next\lst@float\relax}} -\def\lst@KFloat#1\relax{% - \ifx\@empty#1\@empty - \let\lst@float\lst@floatplacement - \else - \def\lst@float{#1}% - \fi} -\lst@Key{floatplacement}{tbp}{\def\lst@floatplacement{#1}} -\lst@AddToHook{PreSet}{\let\lst@float\lst@floatdefault} -\lst@AddToHook{TextStyle}{\let\lst@float\relax} -\let\lst@floatdefault\relax % init -\lst@AddToHook{DeInit}{% - \ifx\lst@float\relax - \global\let\lst@doendpe\@doendpe - \else - \global\let\lst@doendpe\@empty - \fi} -\AtBeginDocument{% -\@ifundefined{c@float@type}% - {\edef\ftype@lstlisting{\ifx\c@figure\@undefined 1\else 4\fi}} - {\edef\ftype@lstlisting{\the\c@float@type}% - \addtocounter{float@type}{\value{float@type}}}% -} -\lst@Key{aboveskip}\medskipamount{\def\lst@aboveskip{#1}} -\lst@Key{belowskip}\medskipamount{\def\lst@belowskip{#1}} -\lst@AddToHook{TextStyle} - {\let\lst@aboveskip\z@ \let\lst@belowskip\z@} -\lst@Key{everydisplay}{}{\def\lst@EveryDisplay{#1}} -\lst@AddToHook{TextStyle}{\let\lst@ifdisplaystyle\iffalse} -\lst@AddToHook{DisplayStyle}{\let\lst@ifdisplaystyle\iftrue} -\let\lst@ifdisplaystyle\iffalse -\def\lst@Init#1{% - \begingroup - \ifx\lst@float\relax\else - \edef\@tempa{\noexpand\lst@beginfloat{lstlisting}[\lst@float]}% - \expandafter\@tempa - \fi - \ifx\lst@multicols\@empty\else - \edef\lst@next{\noexpand\multicols{\lst@multicols}} - \expandafter\lst@next - \fi - \ifhmode\ifinner \lst@boxtrue \fi\fi - \lst@ifbox - \lsthk@BoxUnsafe - \hbox to\z@\bgroup - $\if t\lst@boxpos \vtop - \else \if b\lst@boxpos \vbox - \else \vcenter \fi\fi - \bgroup \par\noindent - \else - \lst@ifdisplaystyle - \lst@EveryDisplay - \par\penalty-50\relax - \vspace\lst@aboveskip - \fi - \fi - \normalbaselines - \abovecaptionskip\lst@abovecaption\relax - \belowcaptionskip\lst@belowcaption\relax - \lst@MakeCaption t% - \lsthk@PreInit \lsthk@Init - \lst@ifdisplaystyle - \global\let\lst@ltxlabel\@empty - \if@inlabel - \lst@ifresetmargins - \leavevmode - \else - \xdef\lst@ltxlabel{\the\everypar}% - \lst@AddTo\lst@ltxlabel{% - \global\let\lst@ltxlabel\@empty - \everypar{\lsthk@EveryLine\lsthk@EveryPar}}% - \fi - \fi - \everypar\expandafter{\lst@ltxlabel - \lsthk@EveryLine\lsthk@EveryPar}% - \else - \everypar{}\let\lst@NewLine\@empty - \fi - \lsthk@InitVars \lsthk@InitVarsBOL - \lst@Let{13}\lst@MProcessListing - \let\lst@Backslash#1% - \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}% - \lst@InitFinalize} -\let\lst@InitFinalize\@empty % init -\lst@AddToHook{PreInit} - {\rightskip\z@ \leftskip\z@ \parfillskip=\z@ plus 1fil - \let\par\@@par} -\lst@AddToHook{EveryLine}{}% init -\lst@AddToHook{EveryPar}{}% init -\lst@Key{showlines}f[t]{\lstKV@SetIf{#1}\lst@ifshowlines} -\def\lst@DeInit{% - \lst@XPrintToken \lst@EOLUpdate - \global\advance\lst@newlines\m@ne - \lst@ifshowlines - \lst@DoNewLines - \else - \setbox\@tempboxa\vbox{\lst@DoNewLines}% - \fi - \lst@ifdisplaystyle \par\removelastskip \fi - \lsthk@ExitVars\everypar{}\lsthk@DeInit\normalbaselines\normalcolor - \lst@MakeCaption b% - \lst@ifbox - \egroup $\hss \egroup - \vrule\@width\lst@maxwidth\@height\z@\@depth\z@ - \else - \lst@ifdisplaystyle - \par\penalty-50\vspace\lst@belowskip - \fi - \fi - \ifx\lst@multicols\@empty\else - \def\lst@next{\global\let\@checkend\@gobble - \endmulticols - \global\let\@checkend\lst@@checkend} - \expandafter\lst@next - \fi - \ifx\lst@float\relax\else - \expandafter\lst@endfloat - \fi - \endgroup} -\let\lst@@checkend\@checkend -\newdimen\lst@maxwidth % \global -\lst@AddToHook{InitVars}{\global\lst@maxwidth\z@} -\lst@AddToHook{InitVarsEOL} - {\ifdim\lst@currlwidth>\lst@maxwidth - \global\lst@maxwidth\lst@currlwidth - \fi} -\def\lst@EOLUpdate{\lsthk@EOL \lsthk@InitVarsEOL} -\def\lst@MProcessListing{% - \lst@XPrintToken \lst@EOLUpdate \lsthk@InitVarsBOL - \global\advance\lst@lineno\@ne - \ifnum \lst@lineno>\lst@lastline - \lst@ifdropinput \lst@LeaveMode \fi - \ifx\lst@linerange\@empty - \expandafter\expandafter\expandafter\lst@EndProcessListing - \else - \lst@interrange - \lst@GetLineInterval - \expandafter\expandafter\expandafter\lst@SkipToFirst - \fi - \else - \expandafter\lst@BOLGobble - \fi} -\let\lst@EndProcessListing\endinput -\lst@Key{gobble}{0}{\def\lst@gobble{#1}} -\def\lst@BOLGobble{% - \ifnum\lst@gobble>\z@ - \@tempcnta\lst@gobble\relax - \expandafter\lst@BOLGobble@ -\fi} -\def\lst@BOLGobble@@{% - \ifnum\@tempcnta>\z@ - \expandafter\lst@BOLGobble@ - \fi} -\def\lstenv@BOLGobble@@{% - \lst@IfNextChars\lstenv@endstring{\lstenv@End}% - {\advance\@tempcnta\m@ne \expandafter\lst@BOLGobble@@\lst@eaten}} -\def\lst@BOLGobble@#1{% - \let\lst@next#1% - \ifx \lst@next\relax\else - \ifx \lst@next\lst@MProcessListing\else - \ifx \lst@next\lst@processformfeed\else - \ifx \lst@next\lstenv@backslash - \let\lst@next\lstenv@BOLGobble@@ - \else - \let\lst@next\lst@BOLGobble@@ - \ifx #1\lst@processtabulator - \advance\@tempcnta-\lst@tabsize\relax - \ifnum\@tempcnta<\z@ - \lst@length-\@tempcnta \lst@PreGotoTabStop - \fi - \else - \advance\@tempcnta\m@ne - \fi - \fi \fi \fi \fi - \lst@next} -\def\lst@processformfeed{\lst@ProcessFormFeed} -\def\lst@processtabulator{\lst@ProcessTabulator} -\lst@Key{name}\relax{\def\lst@intname{#1}} -\lst@AddToHookExe{PreSet}{\global\let\lst@intname\@empty} -\lst@AddToHook{PreInit}{% - \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl - \global\let\lst@name\lst@arg \global\let\lstname\lst@name} -\def\lst@filenamerpl{_\textunderscore $\textdollar -\textendash} -\def\l@lstlisting#1#2{\@dottedtocline{1}{1.5em}{2.3em}{#1}{#2}} -\lst@UserCommand\lstlistlistingname{Listings} -\lst@UserCommand\lstlistoflistings{\bgroup - \let\contentsname\lstlistlistingname - \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lol}}% - \tableofcontents \egroup} -\@ifundefined{float@listhead}{}{% - \renewcommand*{\lstlistoflistings}{% - \begingroup - \@ifundefined{@restonecoltrue}{}{% - \if@twocolumn - \@restonecoltrue\onecolumn - \else - \@restonecolfalse - \fi - }% - \float@listhead{\lstlistlistingname}% - \parskip\z@\parindent\z@\parfillskip \z@ \@plus 1fil% - \@starttoc{lol}% - \@ifundefined{@restonecoltrue}{}{% - \if@restonecol\twocolumn\fi - }% - \endgroup - }% -} -\AtBeginDocument{% - \@ifundefined{float@addtolists}% - {\gdef\float@addtolists#1{\addtocontents{lol}{#1}}}% - {\let\orig@float@addtolists\float@addtolists - \gdef\float@addtolists#1{% - \addtocontents{lol}{#1}% - \orig@float@addtolists{#1}}}% -}% -\newcommand\lstinline[1][]{% - \leavevmode\bgroup % \hbox\bgroup --> \bgroup - \def\lst@boxpos{b}% - \lsthk@PreSet\lstset{flexiblecolumns,#1}% - \lsthk@TextStyle - \@ifnextchar\bgroup{\afterassignment\lst@InlineG \let\@let@token}% - \lstinline@} -\def\lstinline@#1{% - \lst@Init\relax - \lst@IfNextCharActive{\lst@InlineM#1}{\lst@InlineJ#1}} -\lst@AddToHook{TextStyle}{}% init -\lst@AddToHook{SelectCharTable}{\lst@inlinechars} -\global\let\lst@inlinechars\@empty -\def\lst@InlineM#1{\gdef\lst@inlinechars{% - \lst@Def{`#1}{\lst@DeInit\egroup\global\let\lst@inlinechars\@empty}% - \lst@Def{13}{\lst@DeInit\egroup \global\let\lst@inlinechars\@empty - \PackageError{Listings}{lstinline ended by EOL}\@ehc}}% - \lst@inlinechars} -\def\lst@InlineJ#1{% - \def\lst@temp##1#1{% - \let\lst@arg\@empty \lst@InsideConvert{##1}\lst@arg - \lst@DeInit\egroup}% - \lst@temp} -\def\lst@InlineG{% - \lst@Init\relax - \lst@IfNextCharActive{\lst@InlineM\}}% - {\let\lst@arg\@empty \lst@InlineGJ}} -\def\lst@InlineGJ{\futurelet\@let@token\lst@InlineGJTest} -\def\lst@InlineGJTest{% - \ifx\@let@token\egroup - \afterassignment\lst@InlineGJEnd - \expandafter\let\expandafter\@let@token - \else - \ifx\@let@token\@sptoken - \let\lst@next\lst@InlineGJReadSp - \else - \let\lst@next\lst@InlineGJRead - \fi - \expandafter\lst@next - \fi} -\def\lst@InlineGJEnd{\lst@arg\lst@DeInit\egroup} -\def\lst@InlineGJRead#1{% - \lccode`\~=`#1\lowercase{\lst@lAddTo\lst@arg~}% - \lst@InlineGJ} -\def\lst@InlineGJReadSp#1{% - \lccode`\~=`\ \lowercase{\lst@lAddTo\lst@arg~}% - \lst@InlineGJ#1} -\newcommand\lstMakeShortInline[1][]{% - \def\lst@shortinlinedef{\lstinline[#1]}% - \lstMakeShortInline@}% -\def\lstMakeShortInline@#1{% - \expandafter\ifx\csname lst@ShortInlineOldCatcode\string#1\endcsname\relax - \lst@shortlstinlineinfo{Made }{#1}% - \lst@add@special{#1}% - \expandafter - \xdef\csname lst@ShortInlineOldCatcode\string#1\endcsname{\the\catcode`#1}% - \begingroup - \catcode`\~\active \lccode`\~`#1% - \lowercase{% - \global\expandafter\let - \csname lst@ShortInlineOldMeaning\string#1\endcsname~% - \expandafter\gdef\expandafter~\expandafter{\lst@shortinlinedef#1}}% - \endgroup - \global\catcode`#1\active - \else - \PackageError{Listings}% - {\string\lstMakeShorterInline\ definitions cannot be nested}% - {Use \string\lstDeleteShortInline first.}% - {}% - \fi} -\def\lstDeleteShortInline#1{% - \expandafter\ifx\csname lst@ShortInlineOldCatcode\string#1\endcsname\relax - \PackageError{Listings}% - {#1 is not a short reference for \string\lstinline}% - {Use \string\lstMakeShortInline first.}% - {}% - \else - \lst@shortlstinlineinfo{Deleted }{#1 as}% - \lst@rem@special{#1}% - \global\catcode`#1\csname lst@ShortInlineOldCatcode\string#1\endcsname - \global \expandafter\let% - \csname lst@ShortInlineOldCatcode\string#1\endcsname \relax - \ifnum\catcode`#1=\active - \begingroup - \catcode`\~\active \lccode`\~`#1% - \lowercase{% - \global\expandafter\let\expandafter~% - \csname lst@ShortInlineOldMeaning\string#1\endcsname}% - \endgroup - \fi - \fi} -\def\lst@shortlstinlineinfo#1#2{% - \PackageInfo{Listings}{% - #1\string#2 a short reference for \string\lstinline}} -\def\lst@add@special#1{% - \lst@rem@special{#1}% - \expandafter\gdef\expandafter\dospecials\expandafter - {\dospecials \do #1}% - \expandafter\gdef\expandafter\@sanitize\expandafter - {\@sanitize \@makeother #1}} -\def\lst@rem@special#1{% - \def\do##1{% - \ifnum`#1=`##1 \else \noexpand\do\noexpand##1\fi}% - \xdef\dospecials{\dospecials}% - \begingroup - \def\@makeother##1{% - \ifnum`#1=`##1 \else \noexpand\@makeother\noexpand##1\fi}% - \xdef\@sanitize{\@sanitize}% - \endgroup} -\def\lst@MakePath#1{\ifx\@empty#1\@empty\else\lst@MakePath@#1/\@nil/\fi} -\def\lst@MakePath@#1/{#1/\lst@MakePath@@} -\def\lst@MakePath@@#1/{% - \ifx\@nil#1\expandafter\@gobble - \else \ifx\@empty#1\else #1/\fi \fi - \lst@MakePath@@} -\lst@Key{inputpath}{}{\edef\lst@inputpath{\lst@MakePath{#1}}} -\def\lstinputlisting{% - \begingroup \lst@setcatcodes \lst@inputlisting} -\newcommand\lst@inputlisting[2][]{% - \endgroup - \def\lst@set{#1}% - \IfFileExists{\lst@inputpath#2}% - {\expandafter\lst@InputListing\expandafter{\lst@inputpath#2}}% - {\filename@parse{\lst@inputpath#2}% - \edef\reserved@a{\noexpand\lst@MissingFileError - {\filename@area\filename@base}% - {\ifx\filename@ext\relax tex\else\filename@ext\fi}}% - \reserved@a}% - \lst@doendpe \@newlistfalse \ignorespaces} -\def\lst@MissingFileError#1#2{% - \typeout{^^J! Package Listings Error: File `#1(.#2)' not found.^^J% - ^^JType X to quit or <RETURN> to proceed,^^J% - or enter new name. (Default extension: #2)^^J}% - \message{Enter file name: }% - {\endlinechar\m@ne \global\read\m@ne to\@gtempa}% - \ifx\@gtempa\@empty \else - \def\reserved@a{x}\ifx\reserved@a\@gtempa\batchmode\@@end\fi - \def\reserved@a{X}\ifx\reserved@a\@gtempa\batchmode\@@end\fi - \filename@parse\@gtempa - \edef\filename@ext{% - \ifx\filename@ext\relax#2\else\filename@ext\fi}% - \edef\reserved@a{\noexpand\IfFileExists % - {\filename@area\filename@base.\filename@ext}% - {\noexpand\lst@InputListing % - {\filename@area\filename@base.\filename@ext}}% - {\noexpand\lst@MissingFileError - {\filename@area\filename@base}{\filename@ext}}}% - \expandafter\reserved@a % - \fi} -\let\lst@ifdraft\iffalse -\DeclareOption{draft}{\let\lst@ifdraft\iftrue} -\DeclareOption{final}{\let\lst@ifdraft\iffalse} -\lst@AddToHook{PreSet} - {\lst@ifdraft - \let\lst@ifprint\iffalse - \@gobbletwo\fi\fi - \fi} -\def\lst@InputListing#1{% - \begingroup - \lsthk@PreSet \gdef\lst@intname{#1}% - \expandafter\lstset\expandafter{\lst@set}% - \lsthk@DisplayStyle - \catcode\active=\active - \lst@Init\relax \let\lst@gobble\z@ - \lst@SkipToFirst - \lst@ifprint \def\lst@next{\input{#1}}% - \else \let\lst@next\@empty \fi - \lst@next - \lst@DeInit - \endgroup} -\def\lst@SkipToFirst{% - \ifnum \lst@lineno<\lst@firstline - \lst@BeginDropInput\lst@Pmode - \lst@Let{13}\lst@MSkipToFirst - \lst@Let{10}\lst@MSkipToFirst - \else - \expandafter\lst@BOLGobble - \fi} -\def\lst@MSkipToFirst{% - \global\advance\lst@lineno\@ne - \ifnum \lst@lineno=\lst@firstline - \lst@LeaveMode \global\lst@newlines\z@ - \lsthk@InitVarsBOL - \expandafter\lst@BOLGobble - \fi} -\def\lstenv@DroppedWarning{% - \ifx\lst@dropped\@undefined\else - \PackageWarning{Listings}{Text dropped after begin of listing}% - \fi} -\let\lst@dropped\@undefined % init -\begingroup \lccode`\~=`\^^M\lowercase{% -\gdef\lstenv@Process#1{% - \ifx~#1% - \lstenv@DroppedWarning \let\lst@next\lst@SkipToFirst - \else\ifx^^J#1% - \lstenv@DroppedWarning \let\lst@next\lstenv@ProcessJ - \else - \let\lst@dropped#1\let\lst@next\lstenv@Process - \fi \fi - \lst@next} -}\endgroup -\def\lstenv@ProcessJ{% - \let\lst@arg\@empty - \ifx\@currenvir\lstenv@name - \expandafter\lstenv@ProcessJEnv - \else - \expandafter\def\expandafter\lst@temp\expandafter##1% - \csname end\lstenv@name\endcsname - {\lst@InsideConvert{##1}\lstenv@ProcessJ@}% - \expandafter\lst@temp - \fi} -\begingroup \lccode`\~=`\\\lowercase{% -\gdef\lstenv@ProcessJ@{% - \lst@lExtend\lst@arg - {\expandafter\ \expandafter~\lstenv@endstring}% - \catcode10=\active \lst@Let{10}\lst@MProcessListing - \lst@SkipToFirst \lst@arg} -}\endgroup -\def\lstenv@ProcessJEnv#1\end#2{\def\lst@temp{#2}% - \ifx\lstenv@name\lst@temp - \lst@InsideConvert{#1}% - \expandafter\lstenv@ProcessJ@ - \else - \lst@InsideConvert{#1\\end\{#2\}}% - \expandafter\lstenv@ProcessJEnv - \fi} -\def\lstenv@backslash{% - \lst@IfNextChars\lstenv@endstring - {\lstenv@End}% - {\expandafter\lsts@backslash \lst@eaten}}% -\def\lstenv@End{% - \ifx\@currenvir\lstenv@name - \edef\lst@next{\noexpand\end{\lstenv@name}}% - \else - \def\lst@next{\csname end\lstenv@name\endcsname}% - \fi - \lst@next} -\lst@UserCommand\lstnewenvironment#1#2#{% - \@ifundefined{#1}% - {\let\lst@arg\@empty - \lst@XConvert{#1}\@nil - \expandafter\lstnewenvironment@\lst@arg{#1}{#2}}% - {\PackageError{Listings}{Environment `#1' already defined}\@eha - \@gobbletwo}} -\def\@tempa#1#2#3{% -\gdef\lstnewenvironment@##1##2##3##4##5{% - \begingroup - \global\@namedef{end##2}{\lstenv@Error{##2}}% - \global\@namedef{##2}{\def\lstenv@name{##2}% - \begingroup \lst@setcatcodes \catcode\active=\active - \csname##2@\endcsname}% - \let\l@ngrel@x\global - \let\@xargdef\lstenv@xargdef - \expandafter\new@command\csname##2@\endcsname##3% - {\lsthk@PreSet ##4% - \ifx\@currenvir\lstenv@name - \def\lstenv@endstring{#1#2##1#3}% - \else - \def\lstenv@endstring{#1##1}% - \fi - \@namedef{end##2}{\lst@DeInit ##5\endgroup - \lst@doendpe \@ignoretrue}% - \lsthk@DisplayStyle - \let\lst@EndProcessListing\lstenv@SkipToEnd - \lst@Init\lstenv@backslash - \lst@ifprint - \expandafter\expandafter\expandafter\lstenv@Process - \else - \expandafter\lstenv@SkipToEnd - \fi - \lst@insertargs}% - \endgroup}% -} -\let\lst@arg\@empty \lst@XConvert{end}\{\}\@nil -\expandafter\@tempa\lst@arg -\let\lst@insertargs\@empty -\def\lstenv@xargdef#1{ - \expandafter\lstenv@xargdef@\csname\string#1\endcsname#1} -\def\lstenv@xargdef@#1#2[#3][#4]#5{% - \@ifdefinable#2{% - \gdef#2{% - \ifx\protect\@typeset@protect - \expandafter\lstenv@testopt - \else - \@x@protect#2% - \fi - #1% - {#4}}% - \@yargdef - #1% - \tw@ - {#3}% - {#5}}} -\long\def\lstenv@testopt#1#2{% - \@ifnextchar[{\catcode\active5\relax \lstenv@testopt@#1}% - {#1[{#2}]}} -\def\lstenv@testopt@#1[#2]{% - \catcode\active\active - #1[#2]} -\begingroup \lccode`\~=`\\\lowercase{% -\gdef\lstenv@SkipToEnd{% - \long\expandafter\def\expandafter\lst@temp\expandafter##\expandafter - 1\expandafter~\lstenv@endstring{\lstenv@End}% - \lst@temp} -}\endgroup -\def\lstenv@Error#1{\PackageError{Listings}{Extra \string\end#1}% - {I'm ignoring this, since I wasn't doing a \csname#1\endcsname.}} -\begingroup \lccode`\~=`\^^M\lowercase{% -\gdef\lst@TestEOLChar#1{% - \def\lst@insertargs{#1}% - \ifx ~#1\@empty \else - \ifx^^J#1\@empty \else - \global\let\lst@intname\lst@insertargs - \let\lst@insertargs\@empty - \fi \fi} -}\endgroup -\lstnewenvironment{lstlisting}[2][] - {\lst@TestEOLChar{#2}% - \lstset{#1}% - \csname\@lst @SetFirstNumber\endcsname} - {\csname\@lst @SaveFirstNumber\endcsname} -\lst@Key{fancyvrb}\relax[t]{% - \lstKV@SetIf{#1}\lst@iffancyvrb - \lstFV@fancyvrb} -\ifx\lstFV@fancyvrb\@undefined - \gdef\lstFV@fancyvrb{\lst@RequireAspects{fancyvrb}\lstFV@fancyvrb} -\fi -\@ifundefined{ocp}{} - {\lst@AddToHook{OutputBox}% - {\let\lst@ProcessLetter\@firstofone - \let\lst@ProcessDigit\@firstofone - \let\lst@ProcessOther\@firstofone}} -\DeclareOption*{\expandafter\lst@ProcessOption\CurrentOption\relax} -\def\lst@ProcessOption#1#2\relax{% - \ifx #1!% - \lst@DeleteKeysIn\lst@loadaspects{#2}% - \else - \lst@lAddTo\lst@loadaspects{,#1#2}% - \fi} -\@ifundefined{lst@loadaspects} - {\def\lst@loadaspects{strings,comments,escape,style,language,% - keywords,labels,lineshape,frames,emph,index}% - }{} -\InputIfFileExists{lstpatch.sty}{}{} -\let\lst@ifsavemem\iffalse -\DeclareOption{savemem}{\let\lst@ifsavemem\iftrue} -\DeclareOption{noaspects}{\let\lst@loadaspects\@empty} -\ProcessOptions -\lst@RequireAspects\lst@loadaspects -\let\lst@loadaspects\@empty -\lst@UseHook{SetStyle}\lst@UseHook{EmptyStyle} -\lst@UseHook{SetLanguage}\lst@UseHook{EmptyLanguage} -\InputIfFileExists{listings.cfg}{}{} -\InputIfFileExists{lstlocal.cfg}{}{} -\endinput -%% -%% End of file `listings.sty'. diff --git a/Documentation/SoftwareGuide/LaTeXWrapper.sh.in b/Documentation/SoftwareGuide/LaTeXWrapper.sh.in index f6b0104cd94def7e3b997d772623c4d66ec1930c..9abe22e71a086e0eea6e84b4f8c7c89e647fea83 100644 --- a/Documentation/SoftwareGuide/LaTeXWrapper.sh.in +++ b/Documentation/SoftwareGuide/LaTeXWrapper.sh.in @@ -3,4 +3,4 @@ TEXINPUTS=$TEXINPUTS:${ITK_TEXINPUTS} export TEXINPUTS -${LATEX_COMPILER} -file-line-error -halt-on-error "$@" +${LATEX_COMPILER} -file-line-error -halt-on-error -shell-escape "$@" diff --git a/Documentation/SoftwareGuide/Latex/CMakeLists.txt b/Documentation/SoftwareGuide/Latex/CMakeLists.txt index 3999ce795c20b579574e7ba49f80ff212ac025a1..5b04644722c4da5fa9b35047d32813fecc19db2d 100644 --- a/Documentation/SoftwareGuide/Latex/CMakeLists.txt +++ b/Documentation/SoftwareGuide/Latex/CMakeLists.txt @@ -89,7 +89,7 @@ SET(DVIPS_CONVERTER_OPTIONS -D600) # Option for html generation -SET(TEX4HT_OPTIONS html,2,sections+) +SET(TEX4HT_OPTIONS "html,2,sections+ \"\" \"\" -shell-escape") SET (HTML_OUTPUT "SoftwareGuide-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}") # Copy RELEASE_NOTES.txt from OTB source tree to Software Guide build directory diff --git a/Documentation/SoftwareGuide/Latex/Classification.tex b/Documentation/SoftwareGuide/Latex/Classification.tex index 90e4b41d462b8f717722d811ffcf49a5cd8bad7f..1ff8502157758e3c04540583c2c71933a8168db9 100644 --- a/Documentation/SoftwareGuide/Latex/Classification.tex +++ b/Documentation/SoftwareGuide/Latex/Classification.tex @@ -111,7 +111,7 @@ the later case, it creates several threads using OpenMP. There is a factory mechanism on top of the model class (see \doxygen{otb}{MachineLearningModelFactory}). Given an input file, the static function \code{CreateMachineLearningModel(...)} is able -to instanciate a model of the right type. +to instantiate a model of the right type. For unsupervised models, the target samples \textbf{still have to be set}. They won't be used so you can fill a ListSample with zeros. diff --git a/Documentation/SoftwareGuide/Latex/Persistent.tex b/Documentation/SoftwareGuide/Latex/Persistent.tex index 240725fcdf71e9c88a9c00f2f7eed68eb55e2049..5474815669d596f2c934908274a8d6d1b5dab4a5 100644 --- a/Documentation/SoftwareGuide/Latex/Persistent.tex +++ b/Documentation/SoftwareGuide/Latex/Persistent.tex @@ -112,17 +112,17 @@ section~\ref{chapter:WriteAFilter}, page~\pageref{chapter:WriteAFilter}. The first step is to write a persistent mean image filter. We need to include the appropriate header : -\begin{lstlisting} +\begin{cppcode} #include "otbPersistentImageFilter.h" -\end{lstlisting} +\end{cppcode} Then, we declare the class prototype as follows: -\begin{lstlisting} +\begin{cppcode} template<class TInputImage > class ITK_EXPORT PersistentMeanImageFilter : public PersistentImageFilter<TInputImage, TInputImage> -\end{lstlisting} +\end{cppcode} Since the output image will only be used for streaming purpose, we do not need to declare different input and output template types. @@ -131,14 +131,14 @@ In the \emph{private} section of the class, we will declare a member which will be used to store temporary results, and a member which will be used to store the final result. -\begin{lstlisting} +\begin{cppcode} private: // Temporary results container std::vector<PixelType> m_TemporarySums; // Final result member double m_Mean; -\end{lstlisting} +\end{cppcode} Next, we will write the \verb?Reset()? method implementation in the \emph{protected} section of the class. Proper allocation of the @@ -146,7 +146,7 @@ temporary results container with respect to the number of threads is handled here. -\begin{lstlisting} +\begin{cppcode} protected: virtual void Reset() { @@ -160,13 +160,13 @@ protected: // Reset the final result m_Mean = 0.; } -\end{lstlisting} +\end{cppcode} Now, we need to write the \verb?ThreadedGenerateData()? methods (also in the \emph{protected} section), were temporary results will be computed for each piece of stream. -\begin{lstlisting} +\begin{cppcode} virtual void ThreadedGenerateData(const RegionType& outputRegionForThread, itk::ThreadIdType threadId) { @@ -190,12 +190,12 @@ for (it.GoToBegin(); !it.IsAtEnd(); ++it, progress.CompletedPixel()) m_TemporarySums[threadId]+= value; } -\end{lstlisting} +\end{cppcode} Last, we need to define the \verb?Synthetize()? method (still in the \emph{protected} section), which will yield the final results: -\begin{lstlisting} +\begin{cppcode} virtual void Synthetize() { // For each thread @@ -214,7 +214,7 @@ if(nbPixels!=0) m_Mean/=nbPixels; } } -\end{lstlisting} +\end{cppcode} \subsection{Second step: Decorating the filter and using it} @@ -222,41 +222,41 @@ Now, to use the filter, one only has to decorate it with the \doxygen{otb}{PersistentFilterStreamingDecorator}. First step is to include the appropriate header: -\begin{lstlisting} +\begin{cppcode} #include "otbPersistentMeanImageFilter.h" #include "otbPersistentFilterStreamingDecorator.h" -\end{lstlisting} +\end{cppcode} Then, we decorate the filter with some typedefs: -\begin{lstlisting} +\begin{cppcode} typedef otb::PersistentMeanImageFilter<ImageType> PersitentMeanFilterType; typedef otb::PersistentFilterStreamingDecorator < PersitentMeanFilterType> StreamingMeanFilterType; -\end{lstlisting} +\end{cppcode} Now, the decorated filter can be used like any standard filter: -\begin{lstlisting} +\begin{cppcode} StreamingMeanFilterType::Pointer filter = StreamingMeanFilterType::New(); filter->SetInput(reader->GetOutput()); filter->Update(); -\end{lstlisting} +\end{cppcode} \subsection{Third step: one class to rule them all} It is often convenient to avoid the few typedefs of the previous section by deriving a new class from the decorated filter: -\begin{lstlisting} +\begin{cppcode} template<class TInputImage > class ITK_EXPORT StreamingMeanImageFilter : public PersistentFilterStreamingDecorator< PersistentImageFilter<TInputImage, TInputImage> > -\end{lstlisting} +\end{cppcode} This also allows to redefine setters and getters for parameters, avoiding to call the \verb?GetFilter()? method to set them. diff --git a/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex b/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex index dee1a21317409da5cdf59dc1b945e6b680d7bf41..c5bd1dff8218ca02c31995c44a83913874e97c27 100644 --- a/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex +++ b/Documentation/SoftwareGuide/Latex/SoftwareGuide.tex @@ -32,40 +32,14 @@ \definecolor{listlightgray}{gray}{0.955} \definecolor{listwhite}{gray}{1.0} -\usepackage{listings} -\newcommand{\lstsetcpp} -{ -\lstset{frame = tb, - framerule = 0.25pt, - float, - fontadjust, - backgroundcolor={\color{listlightgray}}, - basicstyle = {\ttfamily\footnotesize}, - keywordstyle = {\ttfamily\color{listkeyword}\textbf}, - identifierstyle = {\ttfamily}, - commentstyle = {\ttfamily\color{listcomment}\textit}, - stringstyle = {\ttfamily}, - showstringspaces = false, - showtabs = false, - numbers = none, - numbersep = 6pt, - numberstyle={\ttfamily\color{listnumbers}}, - tabsize = 2, - language=[ANSI]C++, - floatplacement=!h - } -} -\newcommand{\lstsetpython} -{ -\lstset{language=Python - } -} -\newcommand{\lstsetjava} -{ -\lstset{language=Java - } -} +\usepackage{minted} +\newminted{cpp}{fontsize=\small} +\newminted{cmake}{fontsize=\small} +\newminted{bat}{fontsize=\small} +\usepackage{mdframed} +\BeforeBeginEnvironment{cppcode}{\begin{mdframed}[leftline=false,rightline=false,backgroundcolor=listlightgray]} +\AfterEndEnvironment{cppcode}{\end{mdframed}} \newif\ifitkFullVersion \itkFullVersiontrue @@ -170,8 +144,6 @@ colorlinks,linkcolor={blue},citecolor={blue},urlcolor={blue}, \hyperbaseurl{http://www.orfeo-toolbox.org} -\lstsetcpp - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/Documentation/SoftwareGuide/Latex/Tutorial.tex b/Documentation/SoftwareGuide/Latex/Tutorial.tex index ba304a541b6614212a2f07a9cdc47e1d43000e00..be8cd232fc53ecfb8dfe51e5fbae91cb0424fca6 100644 --- a/Documentation/SoftwareGuide/Latex/Tutorial.tex +++ b/Documentation/SoftwareGuide/Latex/Tutorial.tex @@ -36,9 +36,7 @@ directory. The \code{CMakeLists.txt} will be very similar between your projects. Open the \code{CMakeLists.txt} file and write in the few lines: - -\begin{small} -\begin{verbatim} +\begin{cmakecode} PROJECT(Tutorials) cmake_minimum_required(VERSION 2.6) @@ -53,8 +51,7 @@ ENDIF(OTB_FOUND) ADD_EXECUTABLE(HelloWorldOTB HelloWorldOTB.cxx ) TARGET_LINK_LIBRARIES(HelloWorldOTB ${OTB_LIBRARIES}) -\end{verbatim} -\end{small} +\end{cmakecode} The first line defines the name of your project as it appears in Visual Studio @@ -102,8 +99,7 @@ Follow the following steps: \item Create a CMakeLists.txt into the src repository with the following lines: -\begin{verbatim} - +\begin{cmakecode} project(MyFirstProcessing) cmake_minimum_required(VERSION 2.8) @@ -114,10 +110,11 @@ include(${OTB_USE_FILE}) add_executable(MyFirstProcessing MyFirstProcessing.cxx ) target_link_libraries(MyFirstProcessing ${OTB_LIBRARIES} ) -\end{verbatim} +\end{cmakecode} \item Create a MyFirstProcessing.cxx into the src repository with the following lines: -\begin{verbatim} + +\begin{cppcode} #include "otbImage.h" #include "otbVectorImage.h" #include "otbImageFileReader.h" @@ -151,9 +148,9 @@ int main(int argc, char* argv[]) return EXIT_SUCCESS; } -\end{verbatim} +\end{cppcode} \item create a file named BuildMyFirstProcessing.bat into the MyFirstCode directory with the following lines: -\begin{verbatim} +\begin{batcode} @echo off set /A ARGS_COUNT=0 @@ -193,7 +190,7 @@ echo You need to run this script from an OSGeo4W shell GOTO :END :END -\end{verbatim} +\end{batcode} \item into a OSGEo4W shell, run the configure.bat with the right arguments: full path to your src directory, full path to your build directory, full path to the place where find OTBConfig.cmake file (should be C:\textbackslash path\textbackslash to\textbackslash MyOTBDir\textbackslash install\textbackslash lib\textbackslash otb). \item into the OSGeo4W shell, open the MyFirstProcessing.sln \item build the solution @@ -212,12 +209,10 @@ write images and the basics of the pipeline system. First, let's add the following lines at the end of the \code{CMakeLists.txt} file: -\begin{small} -\begin{verbatim} +\begin{cmakecode} ADD_EXECUTABLE(Pipeline Pipeline.cxx ) TARGET_LINK_LIBRARIES(Pipeline ${OTB_LIBRARIES}) -\end{verbatim} -\end{small} +\end{cmakecode} Now, create a \code{Pipeline.cxx} file. @@ -264,12 +259,10 @@ reader and the writer. Let's first add the 2 following lines to the \code{CMakeLists.txt} file: -\begin{small} -\begin{verbatim} +\begin{cmakecode} ADD_EXECUTABLE(FilteringPipeline FilteringPipeline.cxx ) TARGET_LINK_LIBRARIES(FilteringPipeline ${OTB_LIBRARIES}) -\end{verbatim} -\end{small} +\end{cmakecode} \input{FilteringPipeline.tex} @@ -303,12 +296,10 @@ To realize this conversion, we will use the Add the two lines to the \code{CMakeLists.txt} file: -\begin{small} -\begin{verbatim} +\begin{cmakecode} ADD_EXECUTABLE(ScalingPipeline ScalingPipeline.cxx ) TARGET_LINK_LIBRARIES(ScalingPipeline ${OTB_LIBRARIES}) -\end{verbatim} -\end{small} +\end{cmakecode} \input{ScalingPipeline} @@ -331,12 +322,10 @@ process multispectral images. Add the following lines in the \code{CMakeLists.txt} file: -\begin{small} -\begin{verbatim} +\begin{cmakecode} ADD_EXECUTABLE(Multispectral Multispectral.cxx ) TARGET_LINK_LIBRARIES(Multispectral ${OTB_LIBRARIES}) -\end{verbatim} -\end{small} +\end{cmakecode} \input{Multispectral} @@ -355,12 +344,10 @@ try it! Add the following lines in the \code{CMakeLists.txt} file: -\begin{small} -\begin{verbatim} +\begin{cmakecode} ADD_EXECUTABLE(SmarterFilteringPipeline SmarterFilteringPipeline.cxx ) TARGET_LINK_LIBRARIES(SmarterFilteringPipeline ${OTB_LIBRARIES}) -\end{verbatim} -\end{small} +\end{cmakecode} \input{SmarterFilteringPipeline} @@ -410,12 +397,10 @@ To get the best of the image processing algorithms, you want to combine these da First you need to add the following lines in the \code{CMakeLists.txt} file: -\begin{small} -\begin{verbatim} +\begin{cmakecode} ADD_EXECUTABLE(OrthoFusion OrthoFusion.cxx) TARGET_LINK_LIBRARIES(OrthoFusion ${OTB_LIBRARIES}) -\end{verbatim} -\end{small} +\end{cmakecode} \input{OrthoFusion} diff --git a/Documentation/SoftwareGuide/Latex/WriteAnApplication.tex b/Documentation/SoftwareGuide/Latex/WriteAnApplication.tex index b4029d13e7dce361ba0a43fb1e5c4306fd3d3cf0..0408cedb434f7fbebf2b916dfa5b07b2cfe9aa60 100644 --- a/Documentation/SoftwareGuide/Latex/WriteAnApplication.tex +++ b/Documentation/SoftwareGuide/Latex/WriteAnApplication.tex @@ -248,14 +248,12 @@ in order to launch each internal application. The order should be compatible wit image parameter connexions. If you want to do "in-memory" connexions, you can do it between two calls to \code{ExecuteInternal()}, for instance : -\small -\begin{lstlisting} +\begin{cppcode} ExecuteInternal("a"); GetInternalApplication("b")->SetParameterInputImage("in", GetInternalApplication("a")->GetParameterOutputImage("out")); ExecuteInternal("b"); -\end{lstlisting} -\normalsize +\end{cppcode} The application BundleToPerfectSensor is a simple example of composite applications. For a more complex example, you can check the application TrainImagesClassifier. diff --git a/Documentation/SoftwareGuide/ParseCxxExamples.pl b/Documentation/SoftwareGuide/ParseCxxExamples.pl index b483b746d57415758580f98720295b531288d1a1..ae880834033fd30504324bbbaf4a13d5045db2e7 100644 --- a/Documentation/SoftwareGuide/ParseCxxExamples.pl +++ b/Documentation/SoftwareGuide/ParseCxxExamples.pl @@ -92,8 +92,7 @@ sub ParseCxxFile { $tagfound = 1; $dumpinglatex = 0; $dumpingcode = 1; - print OUTFILE "\\small\n"; - print OUTFILE "\\begin{lstlisting}\n"; + print OUTFILE "\\begin{cppcode}\n"; } elsif( /$endlatextag/ ) { $tagfound = 1; @@ -102,8 +101,7 @@ sub ParseCxxFile { elsif( /$endcodesnippettag/ ) { $tagfound = 1; $dumpingcode = 0; - print OUTFILE "\\end{lstlisting}\n"; - print OUTFILE "\\normalsize\n"; + print OUTFILE "\\end{cppcode}\n"; } if( !$tagfound ) { if( $dumpinglatex ) { diff --git a/Documentation/SoftwareGuide/Tex4htWrapper.sh.in b/Documentation/SoftwareGuide/Tex4htWrapper.sh.in index a9cb522fdbd7efe91b1ae5244ac583cd15bb42ec..9fec6e8a781c4fd9bcac87f9e3c4e19ef1cc2e0f 100644 --- a/Documentation/SoftwareGuide/Tex4htWrapper.sh.in +++ b/Documentation/SoftwareGuide/Tex4htWrapper.sh.in @@ -4,7 +4,7 @@ TEXINPUTS=$TEXINPUTS:${ITK_TEXINPUTS} export TEXINPUTS -mkdir ${HTML_OUTPUT} +mkdir -p ${HTML_OUTPUT} cd ${HTML_OUTPUT} ${TEX4HT_COMPILER} "$@" ${TEX4HT_OPTIONS} diff --git a/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx index cf7fe71ce79c926b768a23522beef1f84edf009f..54785258d096842fabd6e2692fcf0033fd3edb6f 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbMapProjectionAdapter.cxx @@ -195,9 +195,16 @@ std::string MapProjectionAdapter::GetParameter(const std::string& key) const if (projectionName.compare("ossimTransMercatorProjection") == 0) { const ossimTransMercatorProjection* tmProjection = dynamic_cast<const ossimTransMercatorProjection*>(this->GetMapProjection()); - if (key.compare("ScaleFactor") == 0) + if (!tmProjection) { - return Utils::ConvertToString(tmProjection->getScaleFactor()); + itkExceptionMacro("Error casting object to ossimTransMercatorProjection."); + } + else + { + if (key.compare("ScaleFactor") == 0) + { + return Utils::ConvertToString(tmProjection->getScaleFactor()); + } } } diff --git a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx index 173daeec99126cd7cf288890d5c6d009b3a41b71..d8e234214bff46edfd1d5604390788f735a248b2 100644 --- a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx +++ b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx @@ -110,7 +110,7 @@ protected: "By default, hidden pixels will have the assigned label 0 in the output image. " "It's possible to define the label mask by another value, " "but be careful to not take a label from another class. " - "This application initalize the labels from 0 to N-1, " + "This application initialize the labels from 0 to N-1, " "N is the number of class (defined by 'nc' parameter)."); } diff --git a/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx b/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx index 325d3b9c38b658755999af8d7626293f571e22c8..a646cea9539fc3c8b6dcc5f013a6996ed7bf2a9d 100644 --- a/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx +++ b/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx @@ -128,7 +128,7 @@ void TrainImagesBase::InitClassification() AddApplication( "TrainVectorClassifier", "training", "Model training" ); AddParameter( ParameterType_InputVectorDataList, "io.valid", "Validation Vector Data List" ); - SetParameterDescription( "io.valid", "A list of vector data to select the training samples." ); + SetParameterDescription( "io.valid", "A list of vector data to select the validation samples." ); MandatoryOff( "io.valid" ); ShareClassificationParams(); diff --git a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx index 2bcd26f3a7f08dbae692c8e36e75e6713e8bacc8..4081034a5f0fead34f03f3f0325f0ad6294b5582 100644 --- a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx +++ b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx @@ -48,7 +48,7 @@ LearningApplicationBase<TInputValue,TOutputValue> "in the network to optimize the result."); AddChoice("classifier.ann.t.reg", "Resilient Back-propagation algorithm"); SetParameterDescription("classifier.ann.t.reg", - "Almost the same as the Back-prop algorithm exept that it does not " + "Almost the same as the Back-prop algorithm except that it does not " "take into account the magnitude of the partial derivative (coordinate " "of the gradient) but only its sign."); diff --git a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx index 3ed9b7c18996e89e4be9c11a0e942a334d4e0077..8d510460a6892d3a64124625e3288b8d107a476e 100644 --- a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx +++ b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx @@ -103,7 +103,7 @@ private: "spectrum associated with each pixel is a linear combination of pure" "materials in the recovery area, commonly known as endmembers. Endmembers can" "be estimated using the VertexComponentAnalysis application.\n\n" - "The application allows to estimate the abundance maps with several algorithms :\n" + "The application allows estimating the abundance maps with several algorithms :\n" " * Unconstrained Least Square (ucls)\n" //" * Fully Constrained Least Square (fcls)\n" " * Image Space Reconstruction Algorithm (isra)\n" diff --git a/Modules/Applications/AppImageUtils/app/otbConvert.cxx b/Modules/Applications/AppImageUtils/app/otbConvert.cxx index 4c50e1a2e7b17488d7fc9f8885e762e623c7d46f..51ce7f3eebd9995e9f0a694c1bb27506b5f9292f 100644 --- a/Modules/Applications/AppImageUtils/app/otbConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbConvert.cxx @@ -192,32 +192,40 @@ private: void DoUpdateParameters() ITK_OVERRIDE { // Read information - typedef otb::ImageMetadataInterfaceBase ImageMetadataInterfaceType; - ImageMetadataInterfaceType::Pointer metadataInterface = + if ( HasValue("in") ) + { + typedef otb::ImageMetadataInterfaceBase ImageMetadataInterfaceType; + ImageMetadataInterfaceType::Pointer metadataInterface = ImageMetadataInterfaceFactory::CreateIMI(GetParameterImage("in")->GetMetaDataDictionary()); - int nbBand = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); - SetMaximumParameterIntValue("channels.grayscale.channel", nbBand); - SetMaximumParameterIntValue("channels.rgb.red", nbBand); - SetMaximumParameterIntValue("channels.rgb.green", nbBand); - SetMaximumParameterIntValue("channels.rgb.blue", nbBand); + int nbBand = GetParameterImage("in")->GetNumberOfComponentsPerPixel(); + SetMaximumParameterIntValue("channels.grayscale.channel", nbBand); + SetMaximumParameterIntValue("channels.rgb.red", nbBand); + SetMaximumParameterIntValue("channels.rgb.green", nbBand); + SetMaximumParameterIntValue("channels.rgb.blue", nbBand); - if (nbBand > 1) - { - // get band index : Red/Green/Blue - int bandRed = metadataInterface->GetDefaultDisplay()[0] + 1; - int bandGreen = metadataInterface->GetDefaultDisplay()[1] + 1; - int bandBlue = metadataInterface->GetDefaultDisplay()[2] + 1; - SetDefaultParameterInt("channels.rgb.red", bandRed); - SetDefaultParameterInt("channels.rgb.green", bandGreen); - SetDefaultParameterInt("channels.rgb.blue", bandBlue); - } + if (nbBand > 1) + { + // get band index : Red/Green/Blue + int bandRed = metadataInterface->GetDefaultDisplay()[0] + 1; + int bandGreen = metadataInterface->GetDefaultDisplay()[1] + 1; + int bandBlue = metadataInterface->GetDefaultDisplay()[2] + 1; + SetDefaultParameterInt("channels.rgb.red", bandRed); + SetDefaultParameterInt("channels.rgb.green", bandGreen); + SetDefaultParameterInt("channels.rgb.blue", bandBlue); + } + } + } template<class TImageType> void GenericDoExecute() { + + // Clear previously registered filters + m_Filters.clear(); + std::string rescaleType = this->GetParameterString("type"); if( (rescaleType != "none") && (rescaleType != "linear") && (rescaleType != "log2") ) @@ -379,7 +387,7 @@ private: rescaler->SetGamma(GetParameterFloat("type.linear.gamma")); } - m_TmpFilter = rescaler; + m_Filters.push_back(rescaler.GetPointer()); SetParameterOutputImage<TImageType>("out", rescaler->GetOutput()); } @@ -436,19 +444,19 @@ private: { typedef MultiToMonoChannelExtractROI<FloatVectorImageType::InternalPixelType, typename TImageType::InternalPixelType> ExtractROIFilterType; - typedef ObjectList<ExtractROIFilterType> ExtractROIFilterListType; typedef otb::ImageList<otb::Image<typename TImageType::InternalPixelType> > ImageListType; typedef ImageListToVectorImageFilter<ImageListType, TImageType > ListConcatenerFilterType; typename ImageListType::Pointer imageList; typename ListConcatenerFilterType::Pointer concatener; - typename ExtractROIFilterListType::Pointer extractorList; imageList = ImageListType::New(); concatener = ListConcatenerFilterType::New(); - extractorList = ExtractROIFilterListType::New(); + //m_Filters.push_back(imageList.GetPointer()); + m_Filters.push_back(concatener.GetPointer()); + const bool monoChannel = IsParameterEnabled("channels.grayscale"); // get band order @@ -457,16 +465,15 @@ private: for (auto && channel : channels) { typename ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); + m_Filters.push_back(extractROIFilter.GetPointer()); extractROIFilter->SetInput(GetParameterImage("in")); if (!monoChannel) extractROIFilter->SetChannel(channel); extractROIFilter->UpdateOutputInformation(); - extractorList->PushBack(extractROIFilter); imageList->PushBack(extractROIFilter->GetOutput()); } concatener->SetInput(imageList); concatener->UpdateOutputInformation(); - concatener->Update(); return concatener->GetOutput(); } @@ -503,8 +510,8 @@ private: } } - itk::ProcessObject::Pointer m_TmpFilter; TransferLogType::Pointer m_TransferLog; + std::vector<itk::LightObject::Pointer> m_Filters; }; } diff --git a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx index 6975ae6450479dc494e881dce0d9948f23bc0b0f..813fa5c2d043ed1e4abdc84d2c6af1a4217ec679 100644 --- a/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx +++ b/Modules/Applications/AppImageUtils/app/otbDownloadSRTMTiles.cxx @@ -256,9 +256,16 @@ private: int mode = GetParameterInt("mode"); // Get the inputs - auto inList = this->GetParameterImageList("il"); - auto vectorDataList = this->GetParameterStringList("vl"); - auto nameList = this->GetParameterStringList("names"); + auto inList = FloatVectorImageListType::New(); + std::vector<std::string> vectorDataList; + std::vector<std::string> nameList; + + if (IsParameterEnabled("il") && HasValue("il")) + inList = this->GetParameterImageList("il"); + if (IsParameterEnabled("vl") && HasValue("vl")) + vectorDataList = this->GetParameterStringList("vl"); + if (IsParameterEnabled("names") && HasValue("names")) + nameList = this->GetParameterStringList("names"); std::string tileDir = this->GetParameterString("tiledir"); diff --git a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx index 06da000b882e6c8215e602e79ca01baad1bd9877..7c56aa82da09b946c57ecc5225144e89768fb59a 100644 --- a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx +++ b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx @@ -74,7 +74,7 @@ private: "The list of features and the syntax of muParserX is available at [1].\n\n" "As opposed to muParser (and thus the BandMath OTB-application [2]), " - "muParserX supports vector expressions which allows to output multi-band " + "muParserX supports vector expressions which allows outputting multi-band " "images.\n\n" "Hereafter is a brief reference of the muParserX syntax\n\n" @@ -106,10 +106,10 @@ private: "im1b2Mean\n" " mean of the 2nd component of the 1st input (global statistics)\n\n" - "im1b2Min\n" + "im1b2Mini\n" " minimum of the 2nd component of the 1st input (global statistics)\n\n" - "im1b2Max\n" + "im1b2Maxi\n" " minimum of the 2nd component of the 1st input (global statistics)\n\n" "im1b2Sum\n" diff --git a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx index 7707ead17102762c4c8a23ceb60833d2e61549d8..87e7dc310fa0cc14efda2c900c0b29942d3feb11 100644 --- a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx +++ b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx @@ -186,7 +186,7 @@ private: AddDocTag(Tags::Calibration); AddParameter(ParameterType_InputImage, "in", "Input"); - SetParameterDescription("in", "Input image filename (values in DN)"); + SetParameterDescription("in", "Input image filename"); AddParameter(ParameterType_OutputImage, "out", "Output"); SetParameterDescription("out","Output calibrated image filename"); @@ -205,8 +205,8 @@ private: DisableParameter("milli"); MandatoryOff("milli"); - AddParameter(ParameterType_Empty, "clamp", "Clamp of reflectivity values between [0, 100]"); - SetParameterDescription("clamp", "Clamping in the range [0, 100]. It can be useful to preserve area with specular reflectance."); + AddParameter(ParameterType_Empty, "clamp", "Clamp of reflectivity values between [0, 1]"); + SetParameterDescription("clamp", "Clamping in the range [0, 1]. It can be useful to preserve area with specular reflectance."); EnableParameter("clamp"); MandatoryOff("clamp"); diff --git a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx index d0dfadb1a535ce0c3acafecb650258c3c4d855e1..27f8da837771c4eada660c43b6628e6fa32ec462 100644 --- a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx +++ b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx @@ -64,7 +64,7 @@ private: "This application can be a preliminary step for an object-based analysis.\n\n" "It generates a vector data file containing the regions extracted with " "the MeanShift algorithm. The spatial and range radius parameters allow " - "to adapt the sensitivity of the algorithm depending on the image dynamic " + "adapting the sensitivity of the algorithm depending on the image dynamic " "and resolution. There is a step to remove small regions whose size " "(in pixels) is less than the given 'minsize' parameter. These regions " "are merged to a similar neighbor region. In the output vectors, there " diff --git a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx index dee453835a8e034816bb943bce9b55e78bdad085..8f63bf13ef99f1062726c988b7c6b18a8aa236d5 100644 --- a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx +++ b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx @@ -76,12 +76,12 @@ private: " will speed-up convergence, at the expense of stability of the result.\n\n" "The application outputs the image of the final averaged spectral" - " signatures (fout), and can also optionnaly output the 2D" + " signatures (fout), and can also optionally output the 2D" " displacement field between input pixel position and final pixel" " position after convergence (foutpos).\n\n" "Note that computing an euclidean distance between spectral signatures" - " may be innacurate and that techniques such as color space transform or image" + " may be inaccurate and that techniques such as color space transform or image" " normalisation could be applied before using this application. Also" " note that most satellite images noise model is not gaussian, since" " noise variance linearly depends on radiance (the higher the" diff --git a/Modules/Applications/AppStereo/app/otbBlockMatching.cxx b/Modules/Applications/AppStereo/app/otbBlockMatching.cxx index eaf57ea79a2c47f194d73db7c8e2cdad7db717c2..2ec8f7e63a0c00d90c3156c390ea71ce3af63573 100644 --- a/Modules/Applications/AppStereo/app/otbBlockMatching.cxx +++ b/Modules/Applications/AppStereo/app/otbBlockMatching.cxx @@ -139,9 +139,9 @@ private: " and resampled each input image into epipolar geometry (with " "GridBasedImageResampling).\n\n" "The application searches locally for the displacement between a reference" - " image and a secondary image. The correspondance is evaluated for each " + " image and a secondary image. The correspondence is evaluated for each " "pixel, based on a pair of local neighborhood windows. The displacement " - "evaluated can be 1D (along lines) or 2D. Parameters allows to set the " + "evaluated can be 1D (along lines) or 2D. Parameters allow setting the " "minimum and maximum disparities to search (both for horizontal and " "vertical directions). A winner-take-all approach is used to select the " "best match. There are different metrics implemented to evaluate the " diff --git a/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx b/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx index 6302a912f14fdaf910a80970825a70a384ef8807..25e4b96189fc1549b2875f9e55c255a75611cd38 100644 --- a/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx +++ b/Modules/Applications/AppStereo/app/otbDisparityMapToElevationMap.cxx @@ -124,7 +124,7 @@ private: AddParameter(ParameterType_InputImage,"io.rgrid","Right Grid"); SetParameterDescription("io.rgrid","Right epipolar grid (deformation grid " - "between rigth sensor et disparity spaces)"); + "between right sensor et disparity spaces)"); AddParameter(ParameterType_OutputImage,"io.out","Output elevation map"); SetParameterDescription("io.out", "Output elevation map in ground " diff --git a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx index 13856ec403e303b1c78d95722269879dda56ed1c..b9bb88e318d687d85b48976f43a8b11bbd3d8b23 100644 --- a/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx +++ b/Modules/Core/Common/include/otbImageRegionAdaptativeSplitter.txx @@ -25,7 +25,7 @@ #include "otbMath.h" #include "otbMacro.h" -// Defaut when no tile hint available +// Default when no tile hint available #include "otbImageRegionSquareTileSplitter.h" namespace otb diff --git a/Modules/Core/Common/include/otbModelComponentBase.h b/Modules/Core/Common/include/otbModelComponentBase.h index c23c5a0062c267ec4c4fb87824a1f70246f6f7a2..1bb6180576b50fc517e10733d56c261981a0c944 100644 --- a/Modules/Core/Common/include/otbModelComponentBase.h +++ b/Modules/Core/Common/include/otbModelComponentBase.h @@ -126,7 +126,7 @@ public: /** Show the parameters in a minimal form in comparison to PrintSelf */ virtual void ShowParameters(std::ostream& os, itk::Indent indent) const; - // TODO: Distance between distribtions with some kind of member function... + // TODO: Distance between distributions with some kind of member function... protected: ModelComponentBase(); diff --git a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h index c7142a057d434cc1ae0ab30ffc8ee99e10a6241e..eb2dfbc8fb48ed0c381d145721f137db4a62b3f6 100644 --- a/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h +++ b/Modules/Core/LabelMap/include/otbShapeAttributesLabelMapFilter.h @@ -242,14 +242,14 @@ public: /** * Set/Get whether the maximum Feret diameter should be computed or not. The - * defaut value is false, because of the high computation time required. + * default value is false, because of the high computation time required. */ void SetComputeFeretDiameter(bool flag); bool GetComputeFeretDiameter() const; itkBooleanMacro(ComputeFeretDiameter); /** - * Set/Get whether the perimeter should be computed or not. The defaut value + * Set/Get whether the perimeter should be computed or not. The default value * is false, because of the high computation time required. */ void SetComputePerimeter(bool flag); diff --git a/Modules/Filtering/Projection/test/otbGenericRSTransformGenericTest.cxx b/Modules/Filtering/Projection/test/otbGenericRSTransformGenericTest.cxx index 4237cce946a45ebc1a0e7a493d24443d02910c21..3898a1d9b39a9cd3875db865188107ffa07b358b 100644 --- a/Modules/Filtering/Projection/test/otbGenericRSTransformGenericTest.cxx +++ b/Modules/Filtering/Projection/test/otbGenericRSTransformGenericTest.cxx @@ -249,7 +249,7 @@ int otbGenericRSTransformGenericTest(int argc, char * argv[]) if(inRes>inThreshold) { failed = true; - std::cerr<<"Input residual ("<<outRes<<") outpasses the threshold ("<<inThreshold<<")"<<std::endl; + std::cerr<<"Input residual ("<<inRes<<") outpasses the threshold ("<<inThreshold<<")"<<std::endl; std::cerr<<std::endl; } diff --git a/Modules/Filtering/Statistics/include/otbPatternSampler.h b/Modules/Filtering/Statistics/include/otbPatternSampler.h index 5a9b640a622d47224f733ef5a48492ba15e08735..cc9dd9465dfe5be082025a960d0707f64f56c31a 100644 --- a/Modules/Filtering/Statistics/include/otbPatternSampler.h +++ b/Modules/Filtering/Statistics/include/otbPatternSampler.h @@ -49,7 +49,7 @@ public: typedef struct Parameter { /** Maximum size of the internal patterns */ - unsigned long MaxPatternSize; + unsigned long MaxPatternSize = 0; /** First sampling pattern */ std::vector<bool> Pattern1; @@ -59,7 +59,7 @@ public: std::vector<bool> Pattern2; /** Seed used to randomly generate patterns (used only if greater than 0) */ - unsigned int Seed; + unsigned int Seed = 0; bool operator!=(const struct Parameter & param) const; } ParameterType; diff --git a/Modules/IO/TestKernel/src/otbTestDriver.cxx b/Modules/IO/TestKernel/src/otbTestDriver.cxx index 27d45ef1e7618fbb846936483bed12fd70b7f792..349a224db4c88a4816d550d1db463c0a90420c5c 100644 --- a/Modules/IO/TestKernel/src/otbTestDriver.cxx +++ b/Modules/IO/TestKernel/src/otbTestDriver.cxx @@ -114,7 +114,7 @@ int parseCommandLine(int ac, char * av[], std::vector<char *>& remainingArgs) if (oldenv2) { libpath64 += KWSYS_SHARED_FORWARD_PATH_SEP; - libpath64 += oldenv; + libpath64 += oldenv2; } itksys::SystemTools::PutEnv(libpath64.c_str()); } diff --git a/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h b/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h index e9bc4cec29b9b3b45891e0265d63009bff34b76e..e5f53f39c8810b4aeb4fe4fc94b7cfddc5bb7ee0 100644 --- a/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h +++ b/Modules/Learning/LearningBase/include/otbMachineLearningModelTraits.h @@ -37,7 +37,7 @@ namespace otb * and ValueType. * * \tparam TInput : input sample type (can be either a scalar type or - * a VariableLenghtVector + * a VariableLengthVector * \tparam isNumber either TrueType or FalseType for partial * specialization @@ -71,7 +71,7 @@ template <typename TInput> using MLMSampleTraits = MLMSampleTraitsImpl< TInput, * and ValueType. * * \tparam TInput : input sample type (can be either a scalar type or - * a VariableLenghtVector or a FixedArray + * a VariableLengthVector or a FixedArray * \tparam isNumber either TrueType or FalseType for partial * specialization diff --git a/Modules/OBIA/RCC8/test/otbImageToImageRCC8Calculator.cxx b/Modules/OBIA/RCC8/test/otbImageToImageRCC8Calculator.cxx index 90769aaffbad96377b2c5bce41cc5b2b15b23f6a..f9137e47ca3a2162c76936799387c1f7e2a3821c 100644 --- a/Modules/OBIA/RCC8/test/otbImageToImageRCC8Calculator.cxx +++ b/Modules/OBIA/RCC8/test/otbImageToImageRCC8Calculator.cxx @@ -94,7 +94,7 @@ int otbImageToImageRCC8Calculator(int itkNotUsed(argc), char* argv[]) { std::cout << "Test failed: Result with level3AprioriKnowledge "; std::cout << "different from result without a priori knowledge" << std::endl; - std::cout << calc->GetValue() << "!=" << calc1->GetValue() << std::endl; + std::cout << calc->GetValue() << "!=" << calc2->GetValue() << std::endl; return EXIT_FAILURE; } } diff --git a/Modules/Radiometry/Simulation/src/otbSailModel.cxx b/Modules/Radiometry/Simulation/src/otbSailModel.cxx index 1049da6833319c037cbe4ab92ce4512ca8add577..e2c1ef00022c070a7e6dfde9af09a86da8d92bd7 100644 --- a/Modules/Radiometry/Simulation/src/otbSailModel.cxx +++ b/Modules/Radiometry/Simulation/src/otbSailModel.cxx @@ -34,7 +34,7 @@ namespace otb /** Constructor */ SailModel ::SailModel() : m_LAI(2), m_Angl(50), m_PSoil(1), m_Skyl(70), m_HSpot(0.2), - m_TTS(30), m_TTO(0), m_PSI(0), m_FCoverView(0.0), m_UseSoilFile(false) + m_TTS(30), m_TTO(0), m_PSI(0), m_FCoverView(0.0), m_UseSoilFile(false), m_SoilIndex(0) { this->ProcessObject::SetNumberOfRequiredInputs(2); this->ProcessObject::SetNumberOfRequiredOutputs(4); diff --git a/Modules/Remote/Mosaic.remote.cmake b/Modules/Remote/Mosaic.remote.cmake index c6f4a068dfbc4a348c9ca7bd1370a02682353100..035a5bc8101097fe9adbd3b7fc852198abba7a92 100644 --- a/Modules/Remote/Mosaic.remote.cmake +++ b/Modules/Remote/Mosaic.remote.cmake @@ -5,5 +5,5 @@ A more detailed description can be found on the project website: https://github.com/remicres/otb-mosaic " GIT_REPOSITORY https://github.com/remicres/otb-mosaic.git - GIT_TAG master + GIT_TAG 56426908db01f33a5b96311e2a7eaac30ecd8e5d ) diff --git a/Modules/Remote/SertitObject.remote.cmake b/Modules/Remote/SertitObject.remote.cmake index e424926127c501f9886aeb0d0efbd11561dfb24d..75cf492f5fd30f6bb092587a6b469b744c554c45 100644 --- a/Modules/Remote/SertitObject.remote.cmake +++ b/Modules/Remote/SertitObject.remote.cmake @@ -26,5 +26,5 @@ median, variance, kurtosis, skewness. The result could be use to perform further object-oriented image analysis. " GIT_REPOSITORY https://github.com/sertit/SertitObject.git - GIT_TAG 49b6540c774ddb7c2d56e39f6f118c4dfb9b8bd3 + GIT_TAG master ) diff --git a/Modules/Remote/otb-bv.remote.cmake b/Modules/Remote/otb-bv.remote.cmake index 4816ae226460fae6d54424daa86edad2e8888ddd..06e067e6586cc345fed2d1f6aade487cf08350b3 100644 --- a/Modules/Remote/otb-bv.remote.cmake +++ b/Modules/Remote/otb-bv.remote.cmake @@ -25,5 +25,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/otb-bv " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/otb-bv.git - GIT_TAG master + GIT_TAG 0e56e487aebc4a493e25223960560e9ef0ca27ec ) diff --git a/Modules/Remote/otbFFSforGMM.remote.cmake b/Modules/Remote/otbFFSforGMM.remote.cmake index b75c04cbf3866829bd9eac6bab586fa63da0a515..08bfd90bfd136bd4a369e30d4f99c13778de709d 100644 --- a/Modules/Remote/otbFFSforGMM.remote.cmake +++ b/Modules/Remote/otbFFSforGMM.remote.cmake @@ -25,5 +25,5 @@ A more detailed description can be found on the project website: https://github.com/Laadr/otbFFSforGMM " GIT_REPOSITORY https://github.com/Laadr/otbFFSforGMM.git - GIT_TAG f9aa7988fc399d8713f9e28fac15e637a783be6e + GIT_TAG master ) diff --git a/Modules/Remote/otbGRM.remote.cmake b/Modules/Remote/otbGRM.remote.cmake index 383c97da56fe3de3a8ad53ba7fbbf2d7c4c60698..7083c522f2429f630c70049ea3b3e9998de2afb0 100644 --- a/Modules/Remote/otbGRM.remote.cmake +++ b/Modules/Remote/otbGRM.remote.cmake @@ -12,5 +12,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/lassallep/grm " GIT_REPOSITORY https://github.com/orfeotoolbox/GRM - GIT_TAG c53a61d12b895a85c3909130021988730c309cb7 + GIT_TAG develop ) diff --git a/Modules/Remote/phenotb.remote.cmake b/Modules/Remote/phenotb.remote.cmake index d76b4f1cc1b30d88f22aab7c036e413eeaf4c068..aa9e9a8ead204e1b3a4f8492e16825c838da95d7 100644 --- a/Modules/Remote/phenotb.remote.cmake +++ b/Modules/Remote/phenotb.remote.cmake @@ -27,5 +27,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/phenotb " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/phenotb.git - GIT_TAG master + GIT_TAG c9349eb89a652a18b28a40dfb3fa352b76388527 ) diff --git a/Modules/Remote/temporal-gapfilling.remote.cmake b/Modules/Remote/temporal-gapfilling.remote.cmake index 5570ceee08dc704ed1ea8e5897db93d88e03d711..a33a9e0acbf7143a25163b999418e8d7568b111a 100644 --- a/Modules/Remote/temporal-gapfilling.remote.cmake +++ b/Modules/Remote/temporal-gapfilling.remote.cmake @@ -26,5 +26,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/temporalgapfilling " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/temporalgapfilling.git - GIT_TAG master + GIT_TAG 4180f28091fb10029860ada2dcf9c9526d3a55d2 ) diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp index 8e7671c9636dac89080c186b2beed25f47f121f3..ca120f900184cc7ba600c3881b0515a4db80a5d7 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimCosmoSkymedModel.cpp @@ -99,7 +99,7 @@ bool ossimCosmoSkymedModel::InitSensorParams(const ossimKeywordlist &kwl, const /** - * @todo : see on real products (for exemple DESCENDING and ASCENDING) + * @todo : see on real products (for example DESCENDING and ASCENDING) */ const char* orbitDirection_str = kwl.find(prefix,"orbitDirection"); std::string orbitDirection(orbitDirection_str) ; diff --git a/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui b/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui index 300d4072f3c8cc439ba7bcb92f0403d416bb7901..c715d1eb560445763ca9cf4fd63fc23860e596d3 100644 --- a/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui +++ b/Modules/Visualization/Monteverdi/src/mvdPreferencesDialog.ui @@ -120,6 +120,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="toolTip"> + <string>When the image width or height is lower than this minimum, overview generation is not proposed</string> + </property> <property name="text"> <string>Minimum size:</string> </property> @@ -127,6 +130,9 @@ </item> <item row="1" column="2"> <widget class="QSpinBox" name="overviewsSpinBox"> + <property name="toolTip"> + <string>When the image width or height is lower than this minimum, overview generation is not proposed</string> + </property> <property name="maximum"> <number>999999999</number> </property> diff --git a/Modules/Visualization/MonteverdiGui/include/mvdImageViewWidget.h b/Modules/Visualization/MonteverdiGui/include/mvdImageViewWidget.h index 4ce167accb88e5f54e1110b33c80b6e39e6dcd63..c32699f712f9c97cfe2af01fbb7fc1f47452002f 100644 --- a/Modules/Visualization/MonteverdiGui/include/mvdImageViewWidget.h +++ b/Modules/Visualization/MonteverdiGui/include/mvdImageViewWidget.h @@ -163,7 +163,7 @@ public: void SetPickingEnabled( bool ); /** - * This allows to set the fallback behaviour for picking + * This allows setting the fallback behaviour for picking */ void SetPickingDefaultStatus( bool ); /** diff --git a/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h b/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h index 5a2d40ee7936b0b6ddb52cf00c65b7d9318050bc..be92647e6135ad430e80e4c61f7d30de4f2070ee 100644 --- a/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h +++ b/Modules/Visualization/MonteverdiGui/include/mvdProjectionBarWidget.h @@ -69,7 +69,7 @@ class ProjectionBarWidget; * \ingroup OTBMonteverdiGUI * \brief ProjectionBarWidget widget class. * - * This Widget allow to change the zoom level of the current selected projection. + * This Widget allows changing the zoom level of the current selected projection. */ class OTBMonteverdiGUI_EXPORT ProjectionBarWidget : public QWidget { diff --git a/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h b/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h index 1ccb02b6f62c7cfe4a76d7df2de504480d703f43..1b74be77a376285c5b5aa65212f4ab42ff2ef3e3 100644 --- a/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h +++ b/Modules/Visualization/MonteverdiGui/include/mvdQtWidgetParameterInitializers.h @@ -59,6 +59,8 @@ #include "otbWrapperQtWidgetOutputImageParameter.h" #include "otbWrapperQtWidgetOutputProcessXMLParameter.h" #include "otbWrapperQtWidgetOutputVectorDataParameter.h" +#include "otbWrapperQtWidgetComplexInputImageParameter.h" +#include "otbWrapperQtWidgetComplexOutputImageParameter.h" #include "otbWrapperQtWidgetParameterFactory.h" #include "otbWrapperQtWidgetListEditWidget.h" #endif //tag=QT4-boost-compatibility @@ -169,6 +171,22 @@ public: inline result_type operator () ( argument_type widget ) const; }; +/** + * \class ComplexInputImageInitializer + * + * \ingroup OTBMonteverdiGUI + * + * \brief WIP. + */ +class ComplexInputImageInitializer : public std::unary_function< + otb::Wrapper::QtWidgetComplexInputImageParameter*, + void + > +{ +public: + inline result_type operator () ( argument_type widget ) const; +}; + /** * \class InputVectorDataInitializer * @@ -265,6 +283,26 @@ private: QString m_Prefix; }; +/** + * \class ComplexOutputImageInitializer + * + * \ingroup OTBMonteverdiGUI + * + * \brief WIP. + */ +class ComplexOutputImageInitializer : public std::unary_function< + otb::Wrapper::QtWidgetComplexOutputImageParameter*, + void + > +{ +public: + inline ComplexOutputImageInitializer( const QString & prefix ); + inline result_type operator () ( argument_type widget ) const; + +private: + QString m_Prefix; +}; + /** * \class OutputVectorDataInitializer * @@ -407,6 +445,17 @@ InputImageListInitializer // Drop support is done by ParameterListInitializer } +/*****************************************************************************/ +inline +ComplexInputImageInitializer::result_type +ComplexInputImageInitializer +::operator () ( argument_type widget ) const +{ + assert( widget!=NULL ); + + SetupForFilenameDrop( widget, "You can drop filename here." ); +} + /*****************************************************************************/ inline InputFilenameInitializer::result_type @@ -516,6 +565,41 @@ OutputImageInitializer ); } +/*****************************************************************************/ +inline +ComplexOutputImageInitializer +::ComplexOutputImageInitializer( const QString& prefix) : + m_Prefix( prefix ) +{ +} + +/*****************************************************************************/ +inline +ComplexOutputImageInitializer::result_type +ComplexOutputImageInitializer +::operator () ( argument_type widget ) const +{ + assert( widget!=NULL ); + assert( I18nCoreApplication::ConstInstance()!=NULL ); + + if( m_Prefix.isEmpty() ) + { + SetupForFilenameDrop( widget, "You can drop filename here." ); + + assert( qApp!=NULL ); + assert( !qApp->arguments().empty() ); + + SetupOutputFilename( widget ); + } + else + SetupOutputFilename( + widget, + I18nCoreApplication::ConstInstance()->GetResultsDir(), + m_Prefix, + ".tif" + ); +} + /*****************************************************************************/ inline OutputVectorDataInitializer::result_type @@ -639,13 +723,29 @@ SetupForFilenameDrop( W* widget, const char* text ) lineEdit->installEventFilter( eventFilter ); - QObject::connect( - eventFilter, - SIGNAL( FilenameDropped( const QString& ) ), - // to: - lineEdit, - SLOT( setText( const QString& ) ) - ); + // BUG : temporary fix for drag & drop in InputImageParameter + // in the future, all "filename" parameters should have the same behaviour + if (dynamic_cast<otb::Wrapper::QtWidgetInputImageParameter*>(widget) || + dynamic_cast<otb::Wrapper::QtFileSelectionWidget*>(widget)) + { + QObject::connect( + eventFilter, + SIGNAL( FilenameDropped( const QString& ) ), + // to: + widget, + SLOT( SetFileName( const QString& ) ) + ); + } + else + { + QObject::connect( + eventFilter, + SIGNAL( FilenameDropped( const QString& ) ), + // to: + lineEdit, + SLOT( setText( const QString& ) ) + ); + } } /*****************************************************************************/ diff --git a/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx b/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx index b8750a98fadc8979d4790a6b3b6a19aded3de5a8..b11becb03201e8a5714c86285a706d1a364fdd0f 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdQtWidgetView.cxx @@ -348,6 +348,7 @@ QtWidgetView //SetupWidget( widget, InputFilenameListInitializer() ); SetupWidget( widget, InputImageInitializer() ); //SetupWidget( widget, InputImageListInitializer() ); + SetupWidget( widget, ComplexInputImageInitializer() ); SetupWidget( widget, InputProcessXMLInitializer() ); SetupWidget( widget, InputVectorDataInitializer() ); //SetupWidget( widget, InputVectorDataListInitializer() ); @@ -363,6 +364,10 @@ QtWidgetView widget, OutputImageInitializer( m_Application->GetName() ) ); + SetupWidget( + widget, + ComplexOutputImageInitializer( m_Application->GetName() ) + ); SetupWidget( widget, OutputVectorDataInitializer() ); } diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h index c6ae4085c5091eab62f42113bccf755d36a77301..cec459dc965019f1d42396b995b89837138213a8 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h @@ -630,9 +630,9 @@ public: { \ Image##Type::Pointer ret; \ Parameter* param = GetParameterByKey(parameter); \ - if (dynamic_cast<ComplexInputImageParameter*>(param)) \ + ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); \ + if (paramDown) \ { \ - ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); \ ret = paramDown->Get##Image(); \ } \ return ret; \ diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h index 859e6a81e733f238b81e51a80bf8bf665d72d653..601b9450a9bf51cc6340b7d969076e2204d3309b 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h @@ -32,7 +32,7 @@ namespace Wrapper /** \class CompositeApplication * \brief This class is a base class for composite applications * - * This class allows to create & store internal applications with the same logic + * This class allows creating & storing internal applications with the same logic * as parameters. You choose the application type to create, you choose an * identifier (alphanumeric string), and you can give a short description. * Later, you will refer to this application using the identifier. In the diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperProxyParameter.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperProxyParameter.h index 7715c9796c706299721b5379df7258a031a66d89..1a93c2445479aaadc84e3303f01722181bdb4505 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperProxyParameter.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperProxyParameter.h @@ -35,7 +35,7 @@ namespace Wrapper * \brief Parameter class acting as a proxy to a different parameter * * The target parameter of this proxy is defined as a pair of a group parameter - * containing the target and the targets key. It allows to define proxies on + * containing the target and the targets key. It allows defining proxies on * parameters that may be themselves replaced by a proxy * * \ingroup OTBApplicationEngine diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 63ed857a87a46e98c53b0f78cd701b2cc29e1c33..eab4bd78591b418023d6a6acfe9188ee6b0b6e24 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -250,6 +250,10 @@ void Application::SetParameterString(std::string parameter, std::string value, b if ( !paramDown->SetFileName(value) ) otbAppLogCRITICAL( <<"Invalid XML parameter filename " << value <<"."); } + else + { + otbAppLogWARNING( <<"This parameter can't be set using SetParameterString()."); + } this->SetParameterUserValue(parameter, hasUserValueFlag); } diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx index 2363f9a2a3295c695c96526a0e5b28e5842e9de8..4bb5f6159a6af26f09040a54d0ecfe0d604fa7c0 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageListParameter.cxx @@ -89,7 +89,6 @@ InputImageListParameter { } - /*****************************************************************************/ const FloatVectorImageListType * InputImageListParameter diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx index 3d8be1944de6a8a9052cae436d931320ac28b3ad..5ba103723d9d93908d66f14330570e515f9caadd 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputProcessXMLParameter.cxx @@ -320,7 +320,10 @@ OutputProcessXMLParameter::ParseGroup(const std::string& group) //Nothing to do. copy emptyValue value = emptyValue; } - + else if (type == ParameterType_InputProcessXML) + { + continue; + } //get only file name /* if(type == ParameterType_InputFilename || type == ParameterType_InputImage || diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx index 736ad395b5255f46e4ff29d725bbeb64f38f5e36..5d57a8337e73ee2298f313f08c13dc9f2ec5258f 100644 --- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx +++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx @@ -817,18 +817,22 @@ std::string CommandLineLauncher::DisplayParameterHelp(const Parameter::Pointer & if (type == ParameterType_Choice) { - std::vector<std::string> keys = dynamic_cast<ChoiceParameter*>(param.GetPointer())->GetChoiceKeys(); - std::vector<std::string> names = dynamic_cast<ChoiceParameter*>(param.GetPointer())->GetChoiceNames(); + ChoiceParameter* paramDown = dynamic_cast<ChoiceParameter*>(param.GetPointer()); + if (paramDown) + { + std::vector<std::string> keys = paramDown->GetChoiceKeys(); + std::vector<std::string> names = paramDown->GetChoiceNames(); - oss << "["; - for(unsigned int i=0; i<keys.size(); i++) + oss << "["; + for(unsigned int i=0; i<keys.size(); i++) { - oss<<keys[i]; - if( i != keys.size()-1 ) - oss << "/"; + oss<<keys[i]; + if( i != keys.size()-1 ) + oss << "/"; } - oss << "]"; + oss << "]"; + } } if(m_Application->IsMandatory(paramKey)) diff --git a/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h b/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h index d7b42e3083116faed0e1d51627f39c48206114d6..ec1977b33a45fb3cfaf3c5f6f77bd80e135a3545 100644 --- a/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h +++ b/Modules/Wrappers/QtWidget/include/otbQtFileSelectionWidget.h @@ -87,6 +87,7 @@ signals: protected slots: void SelectFile(); void CallFilenameChanged(); + void SetFileName(const QString &); private: QtFileSelectionWidget(const QtFileSelectionWidget&); //purposely not implemented diff --git a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h index da397a519e74687e19513ef9e67c513c8fb34c66..249283011ea5b85fbe7f85aeb32ac1ece4c19691 100644 --- a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h +++ b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexInputImageParameter.h @@ -45,6 +45,9 @@ public: QtWidgetComplexInputImageParameter(ComplexInputImageParameter*, QtWidgetModel*); ~QtWidgetComplexInputImageParameter() ITK_OVERRIDE; + inline const QLineEdit* GetInput() const; + inline QLineEdit* GetInput(); + protected slots: bool SetFileName( const QString& value ); void SelectFile(); @@ -65,6 +68,21 @@ private: QPushButton * m_Button; }; +inline +const QLineEdit* +QtWidgetComplexInputImageParameter +::GetInput() const +{ + return m_Input; +} + +inline +QLineEdit* +QtWidgetComplexInputImageParameter +::GetInput() +{ + return m_Input; +} } } diff --git a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h index af01fc7f5143665eff8cfd97882c0ab941c17ad1..1ec7b3f3250570a5dcb66887de841a40606cd039 100644 --- a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h +++ b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetComplexOutputImageParameter.h @@ -45,11 +45,16 @@ public: QtWidgetComplexOutputImageParameter(ComplexOutputImageParameter*, QtWidgetModel*); ~QtWidgetComplexOutputImageParameter() ITK_OVERRIDE; + inline const QLineEdit* GetInput() const; + inline QLineEdit* GetInput(); + /** Get the PixelType*/ //itkGetMacro(PixelType, int); -protected slots: +public slots: void SetFileName( const QString& value ); + +protected slots: void SelectFile(); void SetPixelType(int pixelType); @@ -72,6 +77,21 @@ private: }; +inline +const QLineEdit* +QtWidgetComplexOutputImageParameter +::GetInput() const +{ + return m_Input; +} + +inline +QLineEdit* +QtWidgetComplexOutputImageParameter +::GetInput() +{ + return m_Input; +} } } diff --git a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h index 01684af9326ed3b20133ddedcce04d9f29f4c8ae..5c970fc5c7b6e41a5c57eed44931d5e3172e1f0d 100644 --- a/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h +++ b/Modules/Wrappers/QtWidget/include/otbWrapperQtWidgetInputImageParameter.h @@ -52,9 +52,12 @@ signals: void FileNameIsSet(); protected slots: - bool SetFileName(); + bool SetFileName(const QString& value); void SelectFile(); +private slots: + void OnEditingFinished(); + private: QtWidgetInputImageParameter(const QtWidgetInputImageParameter&); //purposely not implemented void operator=(const QtWidgetInputImageParameter&); //purposely not implemented diff --git a/Modules/Wrappers/QtWidget/src/itkQtProgressBar.cxx b/Modules/Wrappers/QtWidget/src/itkQtProgressBar.cxx index 0cb434483496fa3ba56ec42359fd8eb5694ac712..ba8070ca0bdd637259fdc6ba9d76828320279c42 100644 --- a/Modules/Wrappers/QtWidget/src/itkQtProgressBar.cxx +++ b/Modules/Wrappers/QtWidget/src/itkQtProgressBar.cxx @@ -62,10 +62,12 @@ QtProgressBar::ProcessEvent( itk::Object * caller, ::itk::ProcessObject::Pointer process = dynamic_cast< itk::ProcessObject *>( caller ); - const int value2 = static_cast<int>( - process->GetProgress() * this->maximum() ); - - emit SetValueChanged( value2 ); + if (process) + { + const int value2 = static_cast<int>( + process->GetProgress() * this->maximum() ); + emit SetValueChanged( value2 ); + } } } @@ -78,10 +80,13 @@ QtProgressBar::ConstProcessEvent( const itk::Object * caller, itk::ProcessObject::ConstPointer process = dynamic_cast< const itk::ProcessObject *>( caller ); - const int v = static_cast<int>( - process->GetProgress() * this->maximum() ); + if (process) + { + const int v = static_cast<int>( + process->GetProgress() * this->maximum() ); - emit SetValueChanged( v ); + emit SetValueChanged( v ); + } } } diff --git a/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx b/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx index d0c6d7842dcc57df46c4e1f701db3b8d5cd78c76..5b4225f479ec6bf70e325f9643b09bcd3ca016fe 100644 --- a/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx +++ b/Modules/Wrappers/QtWidget/src/otbApplicationLauncherQt.cxx @@ -109,7 +109,7 @@ int main(int argc, char* argv[]) int ret = qtApp.exec(); // Clean resources - if (mainWindow) delete mainWindow; + delete mainWindow; app = ITK_NULLPTR; ApplicationRegistry::CleanRegistry(); diff --git a/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx b/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx index 37e4f3eed3ee02c97da7956d506f55d3c82ab98c..44eb911061301a5c3373857794a037ac2059f088 100644 --- a/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx +++ b/Modules/Wrappers/QtWidget/src/otbQtFileSelectionWidget.cxx @@ -116,15 +116,22 @@ QtFileSelectionWidget if( filename.isEmpty() ) return; - m_Input->setText( filename ); + SetFileName(filename); +} +void +QtFileSelectionWidget +::CallFilenameChanged() +{ emit FilenameChanged(); } void QtFileSelectionWidget -::CallFilenameChanged() +::SetFileName(const QString & filename) { + m_Input->setText( filename ); + emit FilenameChanged(); } diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx index d921f3d471563cdb4918647b7deee8ac0255f224..8f9873bbbd81fcc3023d54899d0ec5e92cf32229 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetInputImageParameter.cxx @@ -68,19 +68,13 @@ void QtWidgetInputImageParameter::DoCreateWidget() m_HLayout->setSpacing(0); m_HLayout->setContentsMargins(0, 0, 0, 0); m_Input = new QLineEdit; + m_Input->setToolTip( QString::fromStdString( m_InputImageParam->GetDescription() ) ); - connect( - m_Input, SIGNAL( editingFinished() ), - this, SLOT( SetFileName() ) - ); - - connect( - this, SIGNAL( FileNameIsSet() ), - GetModel(), SLOT( NotifyUpdate() ) - ); + connect( m_Input, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()) ); + connect( this, SIGNAL(FileNameIsSet()), GetModel(), SLOT(NotifyUpdate()) ); m_HLayout->addWidget(m_Input); @@ -115,9 +109,7 @@ QtWidgetInputImageParameter if( filename.isEmpty() ) return; - m_Input->setText( filename ); - - if( !SetFileName() ) + if( !SetFileName(filename) ) { std::ostringstream oss; @@ -133,13 +125,14 @@ QtWidgetInputImageParameter } } -bool QtWidgetInputImageParameter::SetFileName() +bool QtWidgetInputImageParameter::SetFileName(const QString& value) { bool res = true; // save value if( m_InputImageParam->SetFromFileName( - QFile::encodeName( m_Input->text() ).constData() ) == true ) + QFile::encodeName( value ).constData() ) == true ) { + m_Input->setText( value ); // notify of value change QString key( m_InputImageParam->GetKey() ); @@ -152,5 +145,10 @@ bool QtWidgetInputImageParameter::SetFileName() return res; } +void QtWidgetInputImageParameter::OnEditingFinished() +{ + SetFileName( m_Input->text() ); +} + } } diff --git a/Packaging/CMakeLists.txt b/Packaging/CMakeLists.txt index c7f84df71f56992b37adc50a57eafbc1a7a4997d..e2ef02debc16ac329c37da880217b9ab0eb21a2c 100644 --- a/Packaging/CMakeLists.txt +++ b/Packaging/CMakeLists.txt @@ -63,7 +63,7 @@ find_program(ZIP_EXECUTABLE NAMES 7z 7za) set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}") #set CMAKE_MODULE_PATH to be the current source directory. -# This will allow to include all cmake files without full path and .cmake extension! +# This will allow including all cmake files without full path and .cmake extension! set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) #include superbuild_macro for get_version() @@ -93,13 +93,10 @@ set(PKG_OTB_VERSION_STRING ${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}.${P set(PACKAGE_LONG_NAME OrfeoToolBox) set(NAME_SUFFIX "" CACHE STRING "extra suffix for package name") set(PACKAGE_NAME OTB) -if(NAME_SUFFIX) - set(PACKAGE_NAME OTB${NAME_SUFFIX}) -endif() if(APPLE) set(PACKAGE_PLATFORM_NAME "Darwin") elseif(WIN32) - set(PACKAGE_PLATFORM_NAME "win") + set(PACKAGE_PLATFORM_NAME "Win") elseif(LINUX) set(PACKAGE_PLATFORM_NAME "Linux") endif() @@ -110,7 +107,7 @@ endif() # This directory is important. # We stage/keep files that goes into final package in this directory -set(PKG_STAGE_DIR ${PACKAGE_NAME}-${PKG_OTB_VERSION_STRING}-${PACKAGE_PLATFORM_NAME}${PACKAGE_ARCH}) +set(PKG_STAGE_DIR ${PACKAGE_NAME}-${PKG_OTB_VERSION_STRING}-${PACKAGE_PLATFORM_NAME}${PACKAGE_ARCH}${NAME_SUFFIX}) set(PATCHELF_PROGRAM "${CMAKE_BINARY_DIR}/PATCHELF/src/patchelf/src/patchelf") include(External_patchelf) diff --git a/Packaging/Files/linux_pkgsetup.in b/Packaging/Files/linux_pkgsetup.in index 198b112a3dab30cf3c2e1639962d7efe09a691f9..93d5a6a082b7010519334e23bf71d8d5ed230588 100644 --- a/Packaging/Files/linux_pkgsetup.in +++ b/Packaging/Files/linux_pkgsetup.in @@ -20,6 +20,17 @@ # set -e +# verify basic tools are here +which sh >/dev/null 2>&1 || ret=$? +if [ ! -z "$ret" ] ; then echo "ERROR: Missing tool 'which'"; exit 1 ; fi +for tool in dirname find file grep cut sed chmod cat readlink ; do + if [ -z "$(which $tool)" ] ; then + echo "ERROR: Missing tool '${tool}'" + echo "Please install it and make sure it can be found from PATH" + exit 1; + fi +done + DIRNAME_0=$(dirname "$0") cd "$DIRNAME_0" @@ -32,20 +43,16 @@ PATCH_ELF_EXE="$OUT_DIR/patchelf" #do not move below block. it must be before "unset LD_LIBRARY_PATH" code #check if we have any python bindings -OTB_PYTHON_LIB_PATH= if [ -f "$OUT_DIR/lib/python/_otbApplication.so" ] ; then - sed -i "s,OUT_DIR,$OUT_DIR,g" "$OUT_DIR/setup_python.sh" - chmod +x $OUT_DIR/setup_python.sh - . ./setup_python.sh - OTB_PYTHON_LIB_PATH=$OUT_DIR/lib/python + chmod +x "$OUT_DIR/setup_python.sh" + ./setup_python.sh || setup_python_ret=$? fi # No no interference with LD_LIBRARY_PATH unset LD_LIBRARY_PATH -#RK: We cannot avoid -maxdepth 1 option in find command below because, -# there are files in $OUT_DIR/lib/gtk which we CANNOT add new rpath -BINARY_FILES=$(find $OTB_PYTHON_LIB_PATH $OUT_DIR/lib $OUT_DIR/bin $OUT_DIR/lib/otb/applications -maxdepth 1 -type f -exec file {} \; | grep -i elf|cut -f1 -d':') +# we remove files in $OUT_DIR/lib/gtk which we CANNOT add new rpath +BINARY_FILES=$(find "$OUT_DIR/lib" "$OUT_DIR/bin" -type f -exec file {} \; | grep -v '/lib/gtk/' | grep -i elf|cut -f1 -d':') # run patchelf for bin_file in $BINARY_FILES; do #echo "adding rpath to $bin_file" diff --git a/Packaging/Files/macx_pkgsetup.in b/Packaging/Files/macx_pkgsetup.in index 46606ffb164881b7afe4639c42cb1ff6ce3ab519..7c4b5c8e941362bbaf7c68364122b5f52917d2c8 100755 --- a/Packaging/Files/macx_pkgsetup.in +++ b/Packaging/Files/macx_pkgsetup.in @@ -20,6 +20,17 @@ # set -e +# verify basic tools are here (install_name_tool is specific macOS) +which sh >/dev/null 2>&1 || ret=$? +if [ ! -z "$ret" ] ; then echo "ERROR: Missing tool 'which'"; exit 1 ; fi +for tool in dirname find file grep cut sed chmod cat readlink install_name_tool ; do + if [ -z "$(which $tool)" ] ; then + echo "ERROR: Missing tool '${tool}'" + echo "Please install it and make sure it can be found from PATH" + exit 1; + fi +done + DIRNAME_0=$(dirname "$0") cd "$DIRNAME_0" || exit 1 @@ -29,16 +40,9 @@ cd "$DIRNAME_0" || exit 1 OUT_DIR=$(pwd) #do not move below 3 lines. it must be before "unset LD_LIBRARY_PATH" code -sed -i "" "s,OUT_DIR,$OUT_DIR,g" "$OUT_DIR/setup_python.sh" -chmod +x $OUT_DIR/setup_python.sh -./setup_python.sh - -# find install_name_tool -INSTALL_NAME_TOOL=$(which install_name_tool) -if [ -z "$INSTALL_NAME_TOOL" ]; then - echo "install_name_tool does not exists.." - echo "please install install_name_tool and make sure it can be found from PATH" - exit 1; +if [ -f "$OUT_DIR/lib/python/_otbApplication.so" ] ; then + chmod +x "$OUT_DIR/setup_python.sh" + ./setup_python.sh || setup_python_ret=$? fi # no interference with DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH @@ -55,9 +59,9 @@ for input_file in $LIB_FILES $BIN_FILES; do if [ -f "$input_file" ]; then input_file_old_rpaths=$(otool -l "$input_file" | grep -A 3 "LC_RPATH" | grep -oE 'path .* \(offset' | cut -d ' ' -f 2) for rpath_old in $input_file_old_rpaths; do - $INSTALL_NAME_TOOL "-delete_rpath" "$rpath_old" "$input_file" + install_name_tool "-delete_rpath" "$rpath_old" "$input_file" done - $INSTALL_NAME_TOOL "-add_rpath" "$OUT_DIR/lib" "$input_file" + install_name_tool "-add_rpath" "$OUT_DIR/lib" "$input_file" fi done diff --git a/Packaging/Files/selftester.sh b/Packaging/Files/selftester.sh index 69d42e1304a79770bca9ffc2831ab3ac2d9be221..8137cfa29979d09df9e4615a2b618a552cb60d70 100755 --- a/Packaging/Files/selftester.sh +++ b/Packaging/Files/selftester.sh @@ -70,7 +70,7 @@ for name in $OTB_SO_LIBRARIES $OTB_DY_LIBRARIES $OTB_EXE; do elif echo "$F_OUTPUT" | grep -q ': broken symbolic link'; then echo_and_report "$F_OUTPUT" elif echo "$F_OUTPUT" | grep -q -i -e ': ELF .*shared object' -e ': ELF .*executable'; then - LDD_ERRORS=$(ldd "$name" | grep -i -e '=> not found' -e 'not a dynamic executable') + LDD_ERRORS=$(ldd "$name" 2>&1 | grep -v 'you do not have execution permission' | grep -i -e '=> not found' -e 'not a dynamic executable') if [ -n "$LDD_ERRORS" ]; then echo_and_report "ldd $name" echo_and_report "$LDD_ERRORS" @@ -122,25 +122,32 @@ for app in $OTB_APPS; do echo "" >tmp.log "bin/otbgui_$app" >tmp.log 2>&1 & GUI_PID=$! - sleep 5s - # Check process tree - CHILD_PROC=$(ps_children $GUI_PID | grep "bin/otbgui $app") - if [ -n "$CHILD_PROC" ]; then - CHILD_PID=$(echo "$CHILD_PROC" | cut -d ' ' -f 1) - NEXT_CHILD_PROC=$(ps_children "$CHILD_PID" | grep 'otbApplicationLauncherQt') - if [ -n "$NEXT_CHILD_PROC" ]; then - NEXT_CHILD_PID=$(echo "$NEXT_CHILD_PROC" | cut -d ' ' -f 1) - kill -9 "$NEXT_CHILD_PID" - wait "$NEXT_CHILD_PID" 2>/dev/null - else - echo "ERROR: otbApplicationLauncherQt $app failed to launch" - tee -a selftest_report.log < tmp.log - exit_if + CHILD_PID="" + NEXT_CHILD_PID="" + nb_try=0 + while [ -z "$NEXT_CHILD_PID" -a $nb_try -lt 10 ]; do + sleep 1s + CHILD_PROC=$(ps_children $GUI_PID | grep "bin/otbgui $app") + if [ -n "$CHILD_PROC" ]; then + CHILD_PID=$(echo "$CHILD_PROC" | cut -d ' ' -f 1) + NEXT_CHILD_PROC=$(ps_children "$CHILD_PID" | grep 'otbApplicationLauncherQt') + if [ -n "$NEXT_CHILD_PROC" ]; then + NEXT_CHILD_PID=$(echo "$NEXT_CHILD_PROC" | cut -d ' ' -f 1) + fi fi + nb_try=$(( nb_try + 1 )) + done + if [ -n "$NEXT_CHILD_PID" ]; then + kill -9 "$NEXT_CHILD_PID" + wait "$NEXT_CHILD_PID" 2>/dev/null + elif [ -n "$CHILD_PID" ]; then + echo "ERROR: otbApplicationLauncherQt $app failed to launch" + tee -a selftest_report.log < tmp.log + exit_if else - echo "ERROR: bin/otbgui_$app failed to launch" - tee -a selftest_report.log < tmp.log - exit_if + echo "ERROR: bin/otbgui_$app failed to launch" + tee -a selftest_report.log < tmp.log + exit_if fi fi app_index=$(( app_index + 1 )) diff --git a/Packaging/Files/setup_python.sh b/Packaging/Files/setup_python.sh index e24731a88ca3579ff40925d97cf9ffaa87dccd0a..e0f03205ed966f18365d144ed493f805f46eaffc 100755 --- a/Packaging/Files/setup_python.sh +++ b/Packaging/Files/setup_python.sh @@ -19,11 +19,20 @@ # limitations under the License. # +# get current working dir (this should be the install directory) +CWD=$(pwd) + # Setup python environment if [ ! -f "$OTB_PYTHON_EXE" ] ; then OTB_PYTHON_EXE=$(which python) fi +if [ ! -f "$OTB_PYTHON_EXE" ] ; then + printf %s\\n "*****Error occurred during installation******" + printf %s\\n "Python executable not found" + exit 1 +fi + python_major_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[0])") python_minor_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[1])") python_patch_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[2])") @@ -35,7 +44,7 @@ python_check_failed() { printf %s\\n "If you have python2.6 or Python2.7 installed in your system " printf %s\\n "You should set OTB_PYTHON_EXE and re-run this installation script." printf %s\\n "eg: OTB_PYTHON_EXE=/path/to/python2.7 ./OTB-X.Y-Linux64.run" - exit 1; + exit 1 } if [ "$python_major_version" -gt 2 ]; then python_check_failed @@ -64,18 +73,19 @@ do done if [ "$found_python_lib" -eq "1" ]; then - numpy_import_result="$($OTB_PYTHON_EXE -c 'import numpy' 2>&1)" + numpy_import_result="$($OTB_PYTHON_EXE -c 'import numpy' 2>&1)" || numpy_ret=$? if [ ! -z "$numpy_import_result" ]; then - printf %s\\n "*****Error occurred during installation******" - printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )" - printf %s\\n "numpy not installed with '$OTB_PYTHON_EXE'" - printf %s\\n "Check failed with result:" - printf %s\\n "$numpy_import_result" - exit 1; - fi; - printf %s\\n "OTB python bindings will be configured for $OTB_PYTHON_EXE ( version: $python_version )" - printf %s\\n "Found python library: $python_lib_file_path" - #ln -sf "$python_lib_file_path" "OUT_DIR/lib/$python_INSTALLED_SONAME" + printf %s\\n "*****Error occurred during installation******" + printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )" + printf %s\\n "numpy not installed with '$OTB_PYTHON_EXE'" + printf %s\\n "Check failed with result:" + printf %s\\n "$numpy_import_result" + exit 1 + else + printf %s\\n "OTB python bindings will be configured for $OTB_PYTHON_EXE ( version: $python_version )" + printf %s\\n "Found python library: $python_lib_file_path" + fi + #ln -sf "$python_lib_file_path" "$CWD/lib/$python_INSTALLED_SONAME" else printf %s\\n "*****Error occurred during installation******" printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )" @@ -83,5 +93,6 @@ else printf %s\\n "We had searched following directories $python_lib_dirs" printf %s\\n "If you don't have python-dev package installed, install it and make a symlink" printf %s\\n "If you don't have python headers and so installed on a custom location, then make a symlink" - printf %s\\n "eg: ln -s /usr/lib/x86_64-linux-gnu/$python_INSTSONAME OUT_DIR/lib/$python_INSTSONAME" + printf %s\\n "eg: ln -s /usr/lib/x86_64-linux-gnu/$python_INSTSONAME $CWD/lib/$python_INSTSONAME" + exit 1 fi diff --git a/Packaging/makeself/README.md b/Packaging/makeself/README.md index 04b9de80bbc0a71f0d1df86bd7453f1019704c36..116b503c1a38237db7c29a51a0b397a24d218d21 100644 --- a/Packaging/makeself/README.md +++ b/Packaging/makeself/README.md @@ -112,7 +112,7 @@ makeself.sh [args] archive_dir file_name label startup_script [script_args] * _archive_dir_ is the name of the directory that contains the files to be archived * _file_name_ is the name of the archive to be created * _label_ is an arbitrary text string describing the package. It will be displayed while extracting the files. - * _startup_script_ is the command to be executed _from within_ the directory of extracted files. Thus, if you wish to execute a program contain in this directory, you must prefix your command with `./`. For example, `./program` will be fine. The _script_args_ are additionnal arguments for this command. + * _startup_script_ is the command to be executed _from within_ the directory of extracted files. Thus, if you wish to execute a program contain in this directory, you must prefix your command with `./`. For example, `./program` will be fine. The _script_args_ are additional arguments for this command. Here is an example, assuming the user has a package image stored in a **/home/joe/mysoft**, and he wants to generate a self-extracting package named **mysoft.sh**, which will launch the "setup" script initially stored in /home/joe/mysoft : @@ -128,7 +128,7 @@ Archives generated with Makeself can be passed the following arguments: * _--keep_ : Prevent the files to be extracted in a temporary directory that will be removed after the embedded script's execution. The files will then be extracted in the current working directory and will stay here until you remove them. * _--verbose_ : Will prompt the user before executing the embedded command - * _--target dir_ : Allows to extract the archive in an arbitrary place. + * _--target dir_ : Allows extracting the archive in an arbitrary place. * _--nox11_ : Do not spawn a X11 terminal. * _--confirm_ : Prompt the user for confirmation before running the embedded command. * _--info_ : Print out general information about the archive (does not extract). @@ -181,7 +181,7 @@ The latest development version can be grabbed from [GitHub][10]. Feel free to su * **v2.1.5:** Made the md5sum detection consistent with the header code. Check for the presence of the archive directory. Added --encrypt for symmetric encryption through gpg (Eric Windisch). Added support for the digest command on Solaris 10 for MD5 checksums. Check for available disk space before extracting to the target directory (Andreas Schweitzer). Allow extraction to run asynchronously (patch by Peter Hatch). Use file descriptors internally to avoid error messages (patch by Kay Tiong Khoo). * **v2.1.6:** Replaced one dot per file progress with a realtime progress percentage and a spining cursor. Added --noprogress to prevent showing the progress during the decompression. Added --target dir to allow extracting directly to a target directory. (Guy Baconniere) * **v2.2.0:** First major new release in years! Includes many bugfixes and user contributions. Please look at the [project page on Github][10] for all the details. - * **v2.3.0:** Support for archive encryption via GPG or OpenSSL. Added LZO and LZ4 compression support. Options to set the packaging date and stop the umask from being overriden. Optionally ignore check for available disk space when extracting. New option to check for root permissions before extracting. + * **v2.3.0:** Support for archive encryption via GPG or OpenSSL. Added LZO and LZ4 compression support. Options to set the packaging date and stop the umask from being overridden. Optionally ignore check for available disk space when extracting. New option to check for root permissions before extracting. * **v2.3.1:** Various compatibility updates. Added unit tests for Travis CI in the GitHub repo. New --tar-extra, --untar-extra, --gpg-extra, --gpg-asymmetric-encrypt-sign options. ## Links diff --git a/Packaging/makeself/makeself.sh b/Packaging/makeself/makeself.sh index a2bb226d1ece2a46139dd6e8a1866100e10b65cb..5e3990514edf9e585842fcd03f3fd8ee60d1f017 100755 --- a/Packaging/makeself/makeself.sh +++ b/Packaging/makeself/makeself.sh @@ -6,7 +6,7 @@ # Utility to create self-extracting tar.gz archives. # The resulting archive is a file holding the tar.gz archive with # a small Shell script stub that uncompresses the archive to a temporary -# directory and then executes a given script from withing that directory. +# directory and then executes a given script from within that directory. # # Makeself home page: http://makeself.io/ # @@ -39,7 +39,7 @@ # - 2.0.1 : Added --copy # - 2.1.0 : Allow multiple tarballs to be stored in one archive, and incremental updates. # Added --nochown for archives -# Stopped doing redundant checksums when not necesary +# Stopped doing redundant checksums when not necessary # - 2.1.1 : Work around insane behavior from certain Linux distros with no 'uncompress' command # Cleaned up the code to handle error codes from compress. Simplified the extraction code. # - 2.1.2 : Some bug fixes. Use head -n to avoid problems. diff --git a/Packaging/post_install.cmake b/Packaging/post_install.cmake index 29c937e02fcafbfbf7799a00502f3aa1fedf412a..25837facd80d94bb2f1b8ee26f693b6a03dc498f 100644 --- a/Packaging/post_install.cmake +++ b/Packaging/post_install.cmake @@ -18,6 +18,55 @@ # limitations under the License. # +function(sanitize_system_paths input_file) + # does not support Windows ... + if(APPLE) + set(SHARED_EXT "\\.dylib") + elseif(UNIX) + set(SHARED_EXT "\\.so") + endif() + set(filtered_content) + + file(STRINGS "${input_file}" source_file_content NEWLINE_CONSUME) + string(REGEX REPLACE "\n" "\n;" source_file_content "${source_file_content}") + set(SEARCH_REGEX "(^[^#\"]+(LIBRARIES|INCLUDE_DIR[A-Z]*) +\")(.+)(\"[^\"]*)") + + foreach(line ${source_file_content}) + set(filtered_line "${line}") + if(line MATCHES "${SEARCH_REGEX}") + string(REGEX REPLACE "${SEARCH_REGEX}" "\\3" extract_str "${line}" ) + string(REGEX REPLACE ";;" ";" extract_str "${extract_str}") + set(_to_be_removed) + set(_to_be_added) + foreach(path ${extract_str}) + if(IS_ABSOLUTE ${path}) + list(APPEND _to_be_removed "${path}") + if(NOT IS_DIRECTORY ${path}) + if(path MATCHES "^.*/lib[^\\.]+${SHARED_EXT}.*") + string(REGEX REPLACE "^.*/lib([^\\.]+)${SHARED_EXT}.*" "\\1" _lib_name "${path}") + list(APPEND _to_be_added "${_lib_name}") + endif() + endif() + endif() + endforeach() + if(_to_be_removed) + list(REMOVE_ITEM extract_str ${_to_be_removed}) + endif() + if(_to_be_added) + list(INSERT extract_str 0 ${_to_be_added}) + endif() + if(extract_str) + list(REMOVE_DUPLICATES extract_str) + endif() + string(REGEX REPLACE "${SEARCH_REGEX}" "\\1${extract_str}\\4" filtered_line "${line}" ) + endif() + list(APPEND filtered_content "${filtered_line}") + endforeach() + + string(REGEX REPLACE "\n;" "\n" filtered_content "${filtered_content}") + file(WRITE "${input_file}" "${filtered_content}") +endfunction() + #check variables are set foreach(var P_DIRS P_MATCH P_REPLACE) if(NOT ${var}) @@ -42,5 +91,8 @@ foreach( p_dir ${P_DIRS} ) file(WRITE "${cmake_file}" "# This file is modified by OTB after installation. \n${cmake_file_CONTENTS}") endif() + if(UNIX) + sanitize_system_paths(${cmake_file}) + endif() endforeach() # foreach( cmake_file endforeach() # foreach( p_dir diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 51d05f450e770d662bd8bc6ed3c82642777a3316..1f7046b54e1b88e5a70ab7d4afe033b84f40a0bf 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,90 @@ +OTB-v.6.2.0 - Changes since version 6.0.0 (October 26th, 2017) +---------------------------------------------------------- + +* Request for Changes (http://wiki.orfeo-toolbox.org/index.php/Requests_for_Changes): + * Request for Changes-91: Better error messages (adopted, merged) + * Request for Changes-92: Build remote modules as standalone cmake projects (adopted, merged) + * Request for Changes-93: Update third party versions in Superbuild for 6.2 (adopted, merged) + * Request for Changes-94: CookBook licensed under cc-by-sa (adopted, merged) + * Request for Changes-95: Compile OTB with C++14 by default (adopted, merged) + * Request for Changes-96: Long help in otbcli (adopted, merged) + * Request for Changes-97: KMeansClassification reimplemented (adopted, merged) + * Request for Changes-98: Upgrade Monteverdi dependency from QWT 5 to QWT 6 (adopted, merged) + * Request for Changes-99: Refactor ExtractROI application (adopted, merged) + * Request for Changes-100: Add external soil file to Sail model (adopted, merged) + * Request for changes-102: Extend MachineLearningModel sample and target types (adopted, merged) + * Request for changes-103: Improve OTB Applications documentation (part 1) (adopted, merged) + * Request for changes-105: Simplify logging of composite applications (adopted, merged) + * Request for changes-106: All-in-one LSMS application (adopted, merged) + * Request for changes-107: Refactor Convert application (adopted, merged) + * Request for changes-108: Make OTB package great again (adopted, merged) + * Request for changes-109: Refactor PixelValue application (adopted, merged) + * Request for changes-111: SuperBuild dependencies additions for GDAL (adopted, merged) + * Request for changes-112: New-functor-filters (adopted, merged) + * Request for changes-114: Add Daniel McInerney as a new committer (adopted) + * Request for changes-115: Refactoring of DownloadSRTMTiles (adopted, merged) + +* Bugfixes : + * OTB-Qgis + * 0001445: Mean shift segmentation ignoring mask OTB QGIS + + * Documentation + * 0001434: Bibliography references are not set in the Software Guide (PDF version) + * 0001400: Training applications reference documentation do not include shark parameters + * 0001471: Issue with Boolean parameter in the Python application API documentation + + * Monteverdi + * 0001431: RGE Alti files inverted on Monteverdi + * 0001432: RGE Alti files inverted on Monteverdi + * 0001408: Issue in Monteverdi French translation (typo) + + * OTB-Packaging + * 0001449: Issues with OTB 6.1 standalone packages (Linux) + * 0001404: OTB xdk 5.10.1 is not able to compile a simple program on a Ubuntu 16.04 VM + * 0001430: building 6.0.0 fails at otbSFSTextureExtraction.cxx.o + * 0001474: OTB XDK is not working on Linux + * 0001460: Unable to compile OTB 6.2.0 RC1 with superbuild (CURL issue) + + * Orfeo Toolbox (OTB) + * 0001453: Applications crash with inxml paramter (GUI mode) + * 0001405: Crash on optical calibration, TOC mode, GUI only (command line works), only on Mac + * 0001422: Optical Calibration application crash on MacOSX + * 0001401: ktrace reports too many file open for any otbapplication + * 0001439: GUI of ComputeOGRLayersFeaturesStatistics and OGRLayerClassifier crash on certain shape files + * 0001399: missing include_directories call when building external projects + * 0001438: Input Value Type of Classification apps + * 0001420: Change layer name in Monteverdi has no effect + * 0001446: Write mode on the SampleExtraction application + * 0001435: Performance issue on OTB 6.0 otbcli_MeanShiftSmoothing + * 0001407: In TrainImagesClassifier, field selection gets reset all the time + * 0001448: VectorClassifier isn't working for me... + * 0001397: OTBIOkml links only with base, dom, and engine but cmake includes all kml libs + * 0001413: set GDAL_DRIVER_PATH to avoid autoload of gdal driver from another installation + * 0001443: Fails to build with cmake 3.9.0 + * 0001444: cmake fails if OTB_DATA_LARGEINPUT_ROOT is set and OTB_DATA_ROOT is not set + * 0001398: OTB won't parse *.xml metadata file on newest Pleiades data + * 0001418: Two more InXML incorrect tests + * 0001416: Parameter names different in cli and gui version + * 0001417: In windows packages otbenv.cmd and otbenv.bat, GDAL_DATA is set to a folder that does not exist + * 0001425: Cli Command line produced by otbgui_TrainImagesClassifier is wrong + * 0001424: ComputeConfusionMatrix crashes because proj.dll is missing + * 0001403: InXML1 tests fail but report as passed + * 0001419: Fix detection of OpenCV on i386 architecture. + * 0001426: GUI TrainimagesClassifier resets "field name" parameter when another parameter is set + * 0001421: otbenv.bash has windows endline + * 0001402: 404 link on otb-users + * 0001469: Superbuild with Visual Studio 15 2017 + * 0001464: otb_module_impl() called twice in ExternalModuleTemplate + * 0001459: Patch to fix spelling errors + + * OTB-applications + * 0001441: Error in param in template otbTrainLibSVM.txx + * 0001411: Training applications needs field name of type integer + * 0001410: BundleToPerfectSensor composite application does not expose parameters of internal applications + * 0001467: Convert application memory allocation issue + * 0001463: BandMathX not accepting global statistics + + OTB-v.6.0.0 - Changes since version 5.10.1 (May 2th, 2017) ---------------------------------------------------------- diff --git a/SuperBuild/CMake/External_geos.cmake b/SuperBuild/CMake/External_geos.cmake index 921aa4d667cf4ba7f621cb8965ca47af08742c61..477317716e9a893a85feb5df2081d9139d087b84 100644 --- a/SuperBuild/CMake/External_geos.cmake +++ b/SuperBuild/CMake/External_geos.cmake @@ -36,7 +36,7 @@ ExternalProject_Add(GEOS -DGEOS_ENABLE_MACOSX_FRAMEWORK:BOOL=OFF -DGEOS_BUILD_STATIC:BOOL=${BUILD_STATIC_LIBS} -DGEOS_BUILD_SHARED:BOOL=${BUILD_SHARED_LIBS} - CMAKE_COMMAND ${GEOS_CMAKE_COMMAND} + CMAKE_COMMAND ${SB_CMAKE_COMMAND} LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 diff --git a/SuperBuild/CMake/External_glew.cmake b/SuperBuild/CMake/External_glew.cmake index 3f370e28e0642d584cfbdecfb881fa28d71a07e4..964cd1abce2c7bb5702074aa3440aa256bafff18 100644 --- a/SuperBuild/CMake/External_glew.cmake +++ b/SuperBuild/CMake/External_glew.cmake @@ -30,7 +30,7 @@ ExternalProject_Add(GLEW BINARY_DIR ${GLEW_SB_BUILD_DIR} DOWNLOAD_DIR ${DOWNLOAD_LOCATION} INSTALL_DIR ${SB_INSTALL_PREFIX} - CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${SB_CMAKE_CACHE_ARGS} -DBUILD_UTILS:BOOL=OFF ${GLEW_SB_SRC}/build/cmake/ + CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${SB_CMAKE_ARGS} ${SB_CMAKE_CACHE_ARGS} -DBUILD_UTILS:BOOL=OFF ${GLEW_SB_SRC}/build/cmake/ LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 diff --git a/SuperBuild/CMake/External_glut.cmake b/SuperBuild/CMake/External_glut.cmake index 8894a4931c3619b58bb01125b85494ecf2fbb37c..a4a37ca63ed57d4be316aff66679e7d43e15e1d3 100644 --- a/SuperBuild/CMake/External_glut.cmake +++ b/SuperBuild/CMake/External_glut.cmake @@ -41,7 +41,7 @@ else(MSVC) ${GLUT_SB_SRC} ) - set(GLUT_CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${SB_CMAKE_CACHE_ARGS} ${GLUT_SB_SRC} ) + set(GLUT_CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${SB_CMAKE_ARGS} ${SB_CMAKE_CACHE_ARGS} ${GLUT_SB_SRC} ) endif() ExternalProject_Add(GLUT diff --git a/SuperBuild/CMake/External_hdf5.cmake b/SuperBuild/CMake/External_hdf5.cmake index c4a13487e95424e15dc03872465dfb026f1327d5..ce3d2a07e61d3d394265aed4c3c96860597fca0b 100644 --- a/SuperBuild/CMake/External_hdf5.cmake +++ b/SuperBuild/CMake/External_hdf5.cmake @@ -54,3 +54,10 @@ ExternalProject_Add(HDF5 LOG_BUILD 1 LOG_INSTALL 1 ) + +# this should not be needed but see Mantis-1457 +if(UNIX) + set(_SB_HDF5_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include) + set(_SB_HDF5_C_LIBRARY ${SB_INSTALL_PREFIX}/lib/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(_SB_HDF5_HL_LIBRARY ${SB_INSTALL_PREFIX}/lib/libhdf5_hl${CMAKE_SHARED_LIBRARY_SUFFIX}) +endif() diff --git a/SuperBuild/CMake/External_jpeg.cmake b/SuperBuild/CMake/External_jpeg.cmake index 25e6de7b872641c8d6b461df6bab1325f1ce522a..ca4ffbe146265fb0693c62ec5805d72b8d30b409 100644 --- a/SuperBuild/CMake/External_jpeg.cmake +++ b/SuperBuild/CMake/External_jpeg.cmake @@ -24,6 +24,7 @@ SETUP_SUPERBUILD(JPEG) if(WIN32) set(JPEG_CONFIGURE_COMMAND "${SB_CMAKE_COMMAND}" + ${SB_CMAKE_ARGS} ${SB_CMAKE_CACHE_ARGS} -DENABLE_SHARED=TRUE -DENABLE_STATIC=FALSE diff --git a/SuperBuild/CMake/External_netcdf.cmake b/SuperBuild/CMake/External_netcdf.cmake index 01d7a82d0c23bfa0dbea1696a4e2c79b01ef8955..12f2eb3b1ef6ff315a20add843ed2b4d10e7bfaf 100644 --- a/SuperBuild/CMake/External_netcdf.cmake +++ b/SuperBuild/CMake/External_netcdf.cmake @@ -27,6 +27,13 @@ ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(NETCDF HDF5 ZLIB CURL HDF4 JPEG) set(NETCDF_SB_CONFIG) +# this should not be needed but see Mantis-1457 +if(UNIX) + ADD_SUPERBUILD_CMAKE_VAR(NETCDF HDF5_INCLUDE_DIR) + ADD_SUPERBUILD_CMAKE_VAR(NETCDF HDF5_C_LIBRARY) + ADD_SUPERBUILD_CMAKE_VAR(NETCDF HDF5_HL_LIBRARY) +endif() + ExternalProject_Add(NETCDF PREFIX NETCDF URL "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.1.tar.gz" diff --git a/SuperBuild/CMake/External_zlib.cmake b/SuperBuild/CMake/External_zlib.cmake index 6948e1f54244176e582864c1f958a139ea559402..4d68aae34c68274cd70212b3e75d4d3ac7491507 100644 --- a/SuperBuild/CMake/External_zlib.cmake +++ b/SuperBuild/CMake/External_zlib.cmake @@ -49,7 +49,7 @@ endif() #check who uses zdll.lib and remove this hack if(MSVC) ExternalProject_Add_Step(ZLIB msvc_copy_hell - COMMAND ${CMAKE_COMMAND} -E copy ${ZLIB_SB_BUILD_DIR}/zlib.lib ${SB_INSTALL_PREFIX}/lib/zdll.lib + COMMAND ${CMAKE_COMMAND} -E copy ${SB_INSTALL_PREFIX}/lib/zlib.lib ${SB_INSTALL_PREFIX}/lib/zdll.lib DEPENDEES install) endif() diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index bd253df5a9cd69a12fd8c41a3c26cf614b892e1e..affdfdb14115e716864c3ac60205785975b13fe6 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -222,22 +222,12 @@ else() endif() if(UNIX) - if(APPLE) - set(SB_CMAKE_COMMAND env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${CMAKE_COMMAND} ${SB_CMAKE_ARGS}) - set(SB_ENV_CONFIGURE_CMD env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}) - else() - if( DEFINED ENV{LD_LIBRARY_PATH} ) - set(LD_LIBRARY_PATH_VALUE ${SB_INSTALL_PREFIX}/lib:$ENV{LD_LIBRARY_PATH}) - else() - set(LD_LIBRARY_PATH_VALUE ${SB_INSTALL_PREFIX}/lib) - endif() - set(SB_ENV_CONFIGURE_CMD env LD_LIBRARY_PATH=${LD_LIBRARY_PATH_VALUE} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}) - set(SB_CMAKE_COMMAND env LD_LIBRARY_PATH=${LD_LIBRARY_PATH_VALUE} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${CMAKE_COMMAND} ${SB_CMAKE_ARGS}) - endif() + set(SB_CMAKE_COMMAND env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${CMAKE_COMMAND} ${SB_CMAKE_ARGS}) + set(SB_ENV_CONFIGURE_CMD env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}) message(STATUS "Environment setup for Configure (SB_ENV_CONFIGURE_CMD): ${SB_ENV_CONFIGURE_CMD}") else() #windows - set(SB_CMAKE_COMMAND ${CMAKE_COMMAND} ${SB_CMAKE_ARGS}) + set(SB_CMAKE_COMMAND ${CMAKE_COMMAND}) endif() if(CMAKE_C_FLAGS) diff --git a/SuperBuild/patches/NETCDF/netcdf-1-hdfAlt-all.diff b/SuperBuild/patches/NETCDF/netcdf-1-hdfAlt-all.diff index 525853ac15a6c8c58d7d524c0a07187cfdcb0acf..3cb3b494fee6e2847eae140abe23da9e306283ca 100644 --- a/SuperBuild/patches/NETCDF/netcdf-1-hdfAlt-all.diff +++ b/SuperBuild/patches/NETCDF/netcdf-1-hdfAlt-all.diff @@ -1,7 +1,15 @@ diff -burN netcdf-4.4.1.1-orig/CMakeLists.txt netcdf-4.4.1.1/CMakeLists.txt --- netcdf-4.4.1.1-orig/CMakeLists.txt 2017-09-18 19:22:31.832817084 +0200 -+++ netcdf-4.4.1.1/CMakeLists.txt 2017-09-18 19:23:32.001343319 +0200 -@@ -434,12 +434,12 @@ ++++ netcdf-4.4.1.1/CMakeLists.txt 2017-09-30 20:40:55.921482581 +0200 +@@ -76,6 +76,7 @@ + + # For CMAKE_INSTALL_LIBDIR + INCLUDE(GNUInstallDirs) ++SET(CMAKE_INSTALL_LIBDIR lib) + + IF(MSVC) + SET(GLOBAL PROPERTY USE_FOLDERS ON) +@@ -434,12 +435,12 @@ INCLUDE_DIRECTORIES(${MFHDF_H_INCLUDE_DIR}) ENDIF() diff --git a/SuperBuild/patches/QT4/qt4-5-mantis1422-qthread-stacksize-macx.diff b/SuperBuild/patches/QT4/qt4-5-mantis1422-qthread-stacksize-macx.diff new file mode 100644 index 0000000000000000000000000000000000000000..3502ffebbaa75254c2795ab1ac4480bf3fdff6b5 --- /dev/null +++ b/SuperBuild/patches/QT4/qt4-5-mantis1422-qthread-stacksize-macx.diff @@ -0,0 +1,56 @@ +--- qt-everywhere-opensource-src-4.8.7.orig/src/corelib/thread/qthread_unix.cpp 2015-11-23 19:05:40.000000000 +0100 ++++ qt-everywhere-opensource-src-4.8.7/src/corelib/thread/qthread_unix.cpp 2015-11-24 11:22:31.000000000 +0100 +@@ -79,6 +79,7 @@ + #endif + + #if defined(Q_OS_MAC) ++#include <sys/resource.h> // getrlimit/setrlimit + # ifdef qDebug + # define old_qDebug qDebug + # undef qDebug +@@ -649,6 +650,45 @@ + #endif // QT_HAS_THREAD_PRIORITY_SCHEDULING + + ++#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) ++ if (d->stackSize == 0) { ++ // Fix the default (too small) stack size for threads on OS X, ++ // which also affects the thread pool. ++ // See also: ++ // https://bugreports.qt.io/browse/QTBUG-2568 ++ // This fix can also be found in Chromium: ++ // https://chromium.googlesource.com/chromium/src.git/+/master/base/threading/platform_thread_mac.mm#186 ++ ++ // The Mac OS X default for a pthread stack size is 512kB. ++ // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses ++ // DEFAULT_STACK_SIZE for this purpose. ++ // ++ // 512kB isn't quite generous enough for some deeply recursive threads that ++ // otherwise request the default stack size by specifying 0. Here, adopt ++ // glibc's behavior as on Linux, which is to use the current stack size ++ // limit (ulimit -s) as the default stack size. See ++ // glibc-2.11.1/nptl/nptl-init.c's __pthread_initialize_minimal_internal. To ++ // avoid setting the limit below the Mac OS X default or the minimum usable ++ // stack size, these values are also considered. If any of these values ++ // can't be determined, or if stack size is unlimited (ulimit -s unlimited), ++ // stack_size is left at 0 to get the system default. ++ // ++ // Mac OS X normally only applies ulimit -s to the main thread stack. On ++ // contemporary OS X and Linux systems alike, this value is generally 8MB ++ // or in that neighborhood. ++ size_t default_stack_size = 0; ++ struct rlimit stack_rlimit; ++ if (pthread_attr_getstacksize(&attr, &default_stack_size) == 0 && ++ getrlimit(RLIMIT_STACK, &stack_rlimit) == 0 && ++ stack_rlimit.rlim_cur != RLIM_INFINITY) { ++ default_stack_size = ++ std::max(std::max(default_stack_size, ++ static_cast<size_t>(PTHREAD_STACK_MIN)), ++ static_cast<size_t>(stack_rlimit.rlim_cur)); ++ } ++ d->stackSize = default_stack_size; ++ } ++#endif + if (d->stackSize > 0) { + #if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0) + int code = pthread_attr_setstacksize(&attr, d->stackSize); diff --git a/Utilities/Maintenance/SuperbuildDownloadList.sh b/Utilities/Maintenance/SuperbuildDownloadList.sh index d7bd8c493517194cf2ef22accbc6b0e4565d3291..da5c4cb21b1ef11fc29c35284ac361b4894d7827 100755 --- a/Utilities/Maintenance/SuperbuildDownloadList.sh +++ b/Utilities/Maintenance/SuperbuildDownloadList.sh @@ -45,9 +45,9 @@ if [[ "$GIT_BRANCH" =~ release-* ]]; then else VERSION="develop" fi -CMAKE_FILES=$(find $SB_CMAKE_DIR -maxdepth 1 -type f -name "External_*") -DOWNLOAD_LIST=$(grep -h -E '^[^#]*\"https?://.*(\.tar\.gz|\.tar\.bz2|\.tgz|\.tar\.xz|\.zip|export=download).*\"' ${CMAKE_FILES} | - grep -o -E 'https?://[^\"]*' | sort | uniq) +CMAKE_FILES=$(find "${SB_CMAKE_DIR}" -maxdepth 1 -type f -name "External_*") +DOWNLOAD_LIST=$(grep -h -E '^[^#]*\"(ftp|http|https)://.*(\.tar\.gz|\.tar\.bz2|\.tgz|\.tar\.xz|\.zip|export=download).*\"' ${CMAKE_FILES} | + grep -o -E '(ftp|http|https)://[^\"]*' | sort | uniq) DOWNLOAD_NAMES= diff --git a/i18n/fr_FR.ts b/i18n/fr_FR.ts index 54548c52973fc5df1450c1cd369fdb74a02617c0..e9ea1fe258c00eb93564b84ab05b5827bdb86122 100644 --- a/i18n/fr_FR.ts +++ b/i18n/fr_FR.ts @@ -278,8 +278,8 @@ Veuillez, s'il vous plait, supprimer votre répertoire de cache Monteverdi. <translation>Version OTB M.m.pl (nom_de_code)</translation> </message> <message> - <source><p>Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)</p><p>Monteverdi is part of Orfeo Toolbox</p><a href="https://www.orfeo-toolbox.org/">https://www.orfeo-toolbox.org/</a><p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at</p><a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p></source> - <translation></translation> + <source><html><head/><body><p>Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)</p><p>Monteverdi is part of Orfeo Toolbox</p><p><a href="https://www.orfeo-toolbox.org/"><span style=" text-decoration: underline; color:#0000ff;">https://www.orfeo-toolbox.org/</span></a></p><p>Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with<br/>the License. You may obtain a copy of the License at:</p><p><a href="http://www.apache.org/licenses/LICENSE-2.0"><span style=" text-decoration: underline; color:#0000ff;">http://www.apache.org/licenses/LICENSE-2.0</span></a></p><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an <br/>&quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License<br/>for the specific language governing permissions and limitations under the License.</p></body></html></source> + <translation type="unfinished"></translation> </message> </context> <context> @@ -357,6 +357,10 @@ Veuillez, s'il vous plait, supprimer votre répertoire de cache Monteverdi. <source>Unknown</source> <translation>Inconnu</translation> </message> + <message> + <source>No EPSG</source> + <translation>Pas d'EPSG</translation> + </message> </context> <context> <name>mvd::AbstractModel</name> @@ -4607,6 +4611,10 @@ Merci d'en sélectionner un autre.</translation> <source>pixel(s)</source> <translation>pixel(s)</translation> </message> + <message> + <source>When the image width or height is lower than this minimum, overview generation is not proposed</source> + <translation>Lorsque la hauteur ou la largeur d'une image est inférieure à ce minimum, la génération des aperçus n'est pas proposée</translation> + </message> </context> <context> <name>mvd::ProcessObjectObserver</name>