From e04a3f7bc34fada6a357adcf8bcf2021f54d8ff8 Mon Sep 17 00:00:00 2001 From: guigues Date: Mon, 28 Jan 2008 08:25:35 +0000 Subject: [PATCH] *** empty log message *** --- kernel/CMakeLists.txt | 2 +- kernel/cmake/BBTKBuildAllOption.cmake | 25 + kernel/cmake/BBTKBuildDoxygenDoc.cmake | 71 + kernel/cmake/BBTKBuildHtmlDocFromLatex.cmake | 28 + kernel/cmake/BBTKBuildLatexDoc.cmake | 55 + kernel/cmake/BBTKConfigurePackage.cmake | 152 +- kernel/cmake/BBTKConfigurePackage_doc.cmake | 265 +-- kernel/cmake/BBTKConfigurePackage_src.cmake | 23 +- kernel/cmake/BBTKFindLibraries.cmake | 34 + .../cmake/{ADD_DEF.cmake => BBTKMacros.cmake} | 30 + kernel/cmake/BBTKPaths.cmake | 42 + kernel/doc/CMakeLists.txt | 131 ++ kernel/doc/bbtkDevelopersGuide/CMakeLists.txt | 3 + .../bbtkDevelopersGuide.tex | 46 + .../naming_conventions.txt | 81 + kernel/doc/bbtkDoxygen/CMakeLists.txt | 21 + kernel/doc/bbtkDoxygen/CodingStyle.html | 360 +++++ kernel/doc/bbtkDoxygen/DoxyMainPage.txt | 19 + kernel/doc/bbtkDoxygen/Doxyfile.txt | 764 +++++++++ .../bbtkPackageDevelopersGuide/CMakeLists.txt | 3 + .../bbtkPackageDevelopersGuide.tex | 614 +++++++ kernel/doc/bbtkUsersGuide/1plus2plus3.fig | 39 + kernel/doc/bbtkUsersGuide/1plus2plus3.png | Bin 0 -> 1757 bytes kernel/doc/bbtkUsersGuide/Add3.fig | 43 + kernel/doc/bbtkUsersGuide/Add3.png | Bin 0 -> 2616 bytes kernel/doc/bbtkUsersGuide/CMakeLists.txt | 3 + kernel/doc/bbtkUsersGuide/bb-architecture.fig | 64 + kernel/doc/bbtkUsersGuide/bb-architecture.png | Bin 0 -> 6566 bytes kernel/doc/bbtkUsersGuide/bbtkUsersGuide.tex | 1429 +++++++++++++++++ .../bbtkUsersGuide/enter-the-value-of-x.png | Bin 0 -> 4776 bytes kernel/doc/bbtkWebSite/CMakeLists.txt | 30 + kernel/doc/bbtkWebSite/download.html | 96 ++ kernel/doc/bbtkWebSite/home.html | 27 + kernel/doc/bbtkWebSite/install.html | 840 ++++++++++ kernel/doc/bbtkWebSite/menu.html | 99 ++ kernel/doc/config.tex | 179 +++ kernel/doc/index.html | 15 + packages/CMakeLists.txt | 1 + packages/wx/CMakeLists.txt | 174 +- 39 files changed, 5518 insertions(+), 290 deletions(-) create mode 100644 kernel/cmake/BBTKBuildAllOption.cmake create mode 100644 kernel/cmake/BBTKBuildDoxygenDoc.cmake create mode 100644 kernel/cmake/BBTKBuildHtmlDocFromLatex.cmake create mode 100644 kernel/cmake/BBTKBuildLatexDoc.cmake rename kernel/cmake/{ADD_DEF.cmake => BBTKMacros.cmake} (56%) create mode 100644 kernel/cmake/BBTKPaths.cmake create mode 100755 kernel/doc/CMakeLists.txt create mode 100755 kernel/doc/bbtkDevelopersGuide/CMakeLists.txt create mode 100644 kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex create mode 100644 kernel/doc/bbtkDevelopersGuide/naming_conventions.txt create mode 100755 kernel/doc/bbtkDoxygen/CMakeLists.txt create mode 100644 kernel/doc/bbtkDoxygen/CodingStyle.html create mode 100755 kernel/doc/bbtkDoxygen/DoxyMainPage.txt create mode 100755 kernel/doc/bbtkDoxygen/Doxyfile.txt create mode 100755 kernel/doc/bbtkPackageDevelopersGuide/CMakeLists.txt create mode 100644 kernel/doc/bbtkPackageDevelopersGuide/bbtkPackageDevelopersGuide.tex create mode 100644 kernel/doc/bbtkUsersGuide/1plus2plus3.fig create mode 100644 kernel/doc/bbtkUsersGuide/1plus2plus3.png create mode 100644 kernel/doc/bbtkUsersGuide/Add3.fig create mode 100644 kernel/doc/bbtkUsersGuide/Add3.png create mode 100755 kernel/doc/bbtkUsersGuide/CMakeLists.txt create mode 100644 kernel/doc/bbtkUsersGuide/bb-architecture.fig create mode 100644 kernel/doc/bbtkUsersGuide/bb-architecture.png create mode 100644 kernel/doc/bbtkUsersGuide/bbtkUsersGuide.tex create mode 100644 kernel/doc/bbtkUsersGuide/enter-the-value-of-x.png create mode 100644 kernel/doc/bbtkWebSite/CMakeLists.txt create mode 100644 kernel/doc/bbtkWebSite/download.html create mode 100644 kernel/doc/bbtkWebSite/home.html create mode 100644 kernel/doc/bbtkWebSite/install.html create mode 100644 kernel/doc/bbtkWebSite/menu.html create mode 100644 kernel/doc/config.tex create mode 100644 kernel/doc/index.html diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index af6806c..df64591 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -5,7 +5,7 @@ SUBDIRS(src) #----------------------------------------------------------------------------- # Documentation -#SUBDIRS(doc) +SUBDIRS(doc) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- diff --git a/kernel/cmake/BBTKBuildAllOption.cmake b/kernel/cmake/BBTKBuildAllOption.cmake new file mode 100644 index 0000000..599fd81 --- /dev/null +++ b/kernel/cmake/BBTKBuildAllOption.cmake @@ -0,0 +1,25 @@ +#----------------------------------------------------------------------------- +# If --BUILD_ALL is set to ON then all options +# for which the macro SWITCH_ON_IF_BUILD_ALL have been used are set to ON +# The -- prepended to the options ensure that it will appear as the +# first option when running ccmake/CMakeSetup +OPTION(--BUILD_ALL "Build all ?" OFF) +#OPTION(--SET_BUILD_ALL_OFF "Build all ?" OFF) +#MARK_AS_ADVANCED(--SET_BUILD_ALL_OFF) + +MACRO(SWITCH_ON_IF_BUILD_ALL VAR) +#OPTION(--${VAR}_SET_BUILD_ALL_OFF "Build all ?" OFF) +#MARK_AS_ADVANCED(--${VAR}_SET_BUILD_ALL_OFF) +IF (--BUILD_ALL) +# IF (--${VAR}_SET_BUILD_ALL_OFF) +# MESSAGE(ERROR "${VAR} -> Build All OFF") +# SET(--BUILD_ALL OFF CACHE BOOL "Build all ?" FORCE) +# SET(--${VAR}_SET_BUILD_ALL_OFF OFF CACHE BOOL "" FORCE) +# ELSE (--${VAR}_SET_BUILD_ALL_OFF) + SET(${VAR} ON CACHE BOOL "Forced to ON by --BUILD_ALL" FORCE) +# SET(--${VAR}_SET_BUILD_ALL_OFF ON CACHE BOOL "" FORCE) +# MESSAGE(ERROR "Build All -> ${VAR}") +# ENDIF (--${VAR}_SET_BUILD_ALL_OFF) +ENDIF(--BUILD_ALL) +ENDMACRO(SWITCH_ON_IF_BUILD_ALL) +#----------------------------------------------------------------------------- diff --git a/kernel/cmake/BBTKBuildDoxygenDoc.cmake b/kernel/cmake/BBTKBuildDoxygenDoc.cmake new file mode 100644 index 0000000..787a1cc --- /dev/null +++ b/kernel/cmake/BBTKBuildDoxygenDoc.cmake @@ -0,0 +1,71 @@ + + +MACRO(BBTK_BUILD_DOXYGEN_DOC NAME INPUT DOC_RELATIVE_INSTALL_PATH PREDEFINED) + + #-------------------------------------------------------------------------- + SET(USE_DOXYGEN ON CACHE BOOL "" FORCE) + + # Name + SET(DOXYGEN_PROJECT_NAME "${NAME}") + + # Inputs + STRING(REGEX REPLACE ";" " " DOXYGEN_INPUT "${INPUT}") + + # Output dirs + SET(DOXYGEN_HTML_OUTPUT "html") + SET(DOXYGEN_OUTPUT ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH}) + IF(NOT IS_DIRECTORY ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}) + FILE(MAKE_DIRECTORY ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}) + ENDIF(NOT IS_DIRECTORY ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}) + + # Doc exclude + SET(DOXYGEN_EXCLUDE "") + STRING(REGEX REPLACE ";" " " DOXYGEN_EXCLUDE "${DOXYGEN_EXCLUDE}") + + # Log file name + SET(DOXYGEN_LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/doxygen.log") + + # Predefined symbols + STRING(REGEX REPLACE ";" " " DOXYGEN_DOC_PREDEFINED "${PREDEFINED}") + + #--------------------------------------------------------------------------- + # DOT verification + IF(DOT) + GET_FILENAME_COMPONENT(DOXYGEN_DOT_PATH ${DOT} PATH) + SET(DOXYGEN_HAVE_DOT "YES") + ELSE(DOT) + SET(DOXYGEN_DOT_PATH "") + SET(DOXYGEN_HAVE_DOT "NO") + ENDIF(DOT) + + #--------------------------------------------------------------------------- + # Create file and project + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.txt + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.txt + IMMEDIATE + ) + + + ADD_CUSTOM_COMMAND( + OUTPUT ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}/index.html + COMMAND + ${DOXYGEN} + ARGS + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.txt + # DEPENDS bbtk bbi + ) + + ADD_CUSTOM_TARGET(doxygen ALL + DEPENDS ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT}/index.html + ) + + INSTALL( + DIRECTORY + ${DOXYGEN_OUTPUT}/${DOXYGEN_HTML_OUTPUT} + DESTINATION + ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH} + ) + #-------------------------------------------------------------------------- + +ENDMACRO(BBTK_BUILD_DOXYGEN_DOC) diff --git a/kernel/cmake/BBTKBuildHtmlDocFromLatex.cmake b/kernel/cmake/BBTKBuildHtmlDocFromLatex.cmake new file mode 100644 index 0000000..f1d647e --- /dev/null +++ b/kernel/cmake/BBTKBuildHtmlDocFromLatex.cmake @@ -0,0 +1,28 @@ + + +MACRO(BBTK_BUILD_HTML_DOC_FROM_LATEX TEX_FILE) + SET(USE_TTH ON CACHE BOOL "" FORCE) + + #------------------------------------------------------------------------- + ## MESSAGE(STATUS ${LATEX_tth_CONVERTER}) + + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.html + COMMAND + # tth + ${LATEX_tth_CONVERTER} + ARGS + -e2 ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.tex 2>tth.log + # DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.pdf + ) + ADD_CUSTOM_TARGET(${TEX_FILE}.html ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.html + ) + # Install + INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.html + DESTINATION ${CMAKE_INSTALL_PREFIX}/${BBTK_DOC_INSTALL_PATH}/${TEX_FILE} + ) + #------------------------------------------------------------------------- + +ENDMACRO(BBTK_BUILD_HTML_DOC_FROM_LATEX) diff --git a/kernel/cmake/BBTKBuildLatexDoc.cmake b/kernel/cmake/BBTKBuildLatexDoc.cmake new file mode 100644 index 0000000..1bd7644 --- /dev/null +++ b/kernel/cmake/BBTKBuildLatexDoc.cmake @@ -0,0 +1,55 @@ + + +MACRO(BBTK_BUILD_LATEX_DOC TEX_FILE) + + SET(USE_LATEX ON CACHE BOOL "" FORCE) + + #MESSAGE(STATUS "Tex file : ${TEX_FILE}") + #--------------------------------------------------------------------------- + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/${TEX_FILE}.tex + ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.tex + COPYONLY + ) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/../config.tex + ${CMAKE_CURRENT_BINARY_DIR}/config.tex + COPYONLY + ) + #--------------------------------------------------------------------------- + + # Have to run latex twice to get references, toc, etc. + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.aux + COMMAND + # latex + ${LATEX_COMPILER} + ARGS + -interaction=batchmode ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE} -output-directory=${CMAKE_CURRENT_BINARY_DIR}/ + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.tex + ${CMAKE_CURRENT_BINARY_DIR}/config.tex + ) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.pdf + COMMAND + # latex + ${LATEX_COMPILER} + ARGS + -interaction=batchmode ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE} -output-directory=${CMAKE_CURRENT_BINARY_DIR}/ + + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.aux + ) + + # pdf target + ADD_CUSTOM_TARGET(${TEX_FILE}.pdf ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.pdf) + + # Install + INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.pdf + DESTINATION ${CMAKE_INSTALL_PREFIX}/${BBTK_DOC_INSTALL_PATH}/${TEX_FILE} + ) + + +ENDMACRO(BBTK_BUILD_LATEX_DOC) diff --git a/kernel/cmake/BBTKConfigurePackage.cmake b/kernel/cmake/BBTKConfigurePackage.cmake index 0e5fe48..3d41137 100644 --- a/kernel/cmake/BBTKConfigurePackage.cmake +++ b/kernel/cmake/BBTKConfigurePackage.cmake @@ -1,68 +1,112 @@ #--------------------------------------------------------------------------- -# Package dependencies -IF(${BBTK_PACKAGE_NAME}_USE_VTK) - SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE) - SET(BBTK_PACKAGE_LIBS - ${BBTK_PACKAGE_LIBS} - ${BBTK_VTK_LIBRARIES} - ) -ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK) +# If not a core package must find bbtk and include necessary cmake scripts +IF(NOT BBTK_CORE_PACKAGE) +## TO DO +# FIND_LIBRARY(BBTK) +# INCLUDE(${BBTK_DIR}/BBTKMacros.cmake) +# INCLUDE(${BBTK_DIR}/BBTKFindLibraries.cmake) +# etc. +ENDIF(NOT BBTK_CORE_PACKAGE) +#--------------------------------------------------------------------------- -IF(${BBTK_PACKAGE_NAME}_USE_ITK) - SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE) - SET(BBTK_PACKAGE_LIBS - ${BBTK_PACKAGE_LIBS} - ${BBTK_ITK_LIBRARIES} - ) -ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK) +#----------------------------------------------------------------------------- +# DOES THE USER WANT TO BUILD THE PACKAGE ? +OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME} + "Build the bbtk package ${BBTK_PACKAGE_NAME} ?" OFF) +SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}) +#----------------------------------------------------------------------------- -IF(${BBTK_PACKAGE_NAME}_USE_GDCM) - SET(USE_GDCM ON CACHE BOOL "Use GDCM" FORCE) - SET(BBTK_PACKAGE_LIBS - ${BBTK_PACKAGE_LIBS} - ${BBTK_GDCM_LIBRARIES} - ) -ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM) +#----------------------------------------------------------------------------- +# IF THE USER HAS CHOSEN TO BUILD THE PACKAGE +IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}) + #--------------------------------------------------------------------------- -IF(${BBTK_PACKAGE_NAME}_USE_GSMIS) - SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE) - SET(BBTK_PACKAGE_LIBS - ${BBTK_PACKAGE_LIBS} - ${BBTK_GSMIS_LIBRARIES} - ) -ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS) + #--------------------------------------------------------------------------- + # Package dependencies + IF(${BBTK_PACKAGE_NAME}_USE_VTK) + SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE) + SET(BBTK_PACKAGE_LIBS + ${BBTK_PACKAGE_LIBS} + ${BBTK_VTK_LIBRARIES} + ) + ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK) + + IF(${BBTK_PACKAGE_NAME}_USE_ITK) + SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE) + SET(BBTK_PACKAGE_LIBS + ${BBTK_PACKAGE_LIBS} + ${BBTK_ITK_LIBRARIES} + ) + ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK) + + IF(${BBTK_PACKAGE_NAME}_USE_GDCM) + SET(USE_GDCM ON CACHE BOOL "Use GDCM" FORCE) + SET(BBTK_PACKAGE_LIBS + ${BBTK_PACKAGE_LIBS} + ${BBTK_GDCM_LIBRARIES} + ) + ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM) + + IF(${BBTK_PACKAGE_NAME}_USE_GSMIS) + SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE) + SET(BBTK_PACKAGE_LIBS + ${BBTK_PACKAGE_LIBS} + ${BBTK_GSMIS_LIBRARIES} + ) + ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS) + + IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS) + IF(BBTK_CORE_PACKAGE) + SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE) + MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}") + # bbtk already links against wx ... + # SET(BBTK_PACKAGE_LIBS + # ${BBTK_PACKAGE_LIBS} + # ${BBTK_WXWIDGETS_LIBRARIES} + # ) + ELSE(BBTK_CORE_PACKAGE) + # If linking against a non-wx bbtk : problem + IF(NOT BBTK_USE_WXWIDGETS) + MESSAGE(FATAL_ERROR "The bbtk package ${BBTK_PACKAGE_NAME} needs wxWidgets however the bbtk library which was found on your system was not compiled with wxWidgets : recompile it and rebuild the package.") + ELSE(NOT BBTK_USE_WXWIDGETS) + SET(USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE) + ENDIF(NOT BBTK_USE_WXWIDGETS) + ENDIF(BBTK_CORE_PACKAGE) + ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS) -IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS) - SET(BBTK_USE_WXWIDGETS ON CACHE BOOL "Use wxWidgets" FORCE) - MESSAGE(STATUS "BBTK_USE_WXWIDGETS forced to ON by the compilation of the package ${BBTK_PACKAGE_NAME}") - # bbtk already links against wx ... - # SET(BBTK_PACKAGE_LIBS - # ${BBTK_PACKAGE_LIBS} - # ${BBTK_WXWIDGETS_LIBRARIES} - # ) -ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS) + #--------------------------------------------------------------------------- + #---------------------------------------------------------------------------- + # DEFINES ${PACKAGE_NAME}_AUTHOR + # ADD_DEFINITIONS( -D${PACKAGE_NAME}_AUTHOR="${PACKAGE_AUTHOR}") + #---------------------------------------------------------------------------- + #---------------------------------------------------------------------------- + # DEFINES ${PACKAGE_NAME}_DESCRIPTION + # ADD_DEFINITIONS( -D${PACKAGE_NAME}_DESCRIPTION="${PACKAGE_DESCRIPTION}") + #---------------------------------------------------------------------------- + #---------------------------------------------------------------------------- + # DEFINES ${BBTK_PACKAGE_NAME}_VERSION + SET(BBTK_PACKAGE_VERSION + "${BBTK_PACKAGE_MAJOR_VERSION}.${BBTK_PACKAGE_MINOR_VERSION}.${BBTK_PACKAGE_BUILD_VERSION}") + #ADD_DEFINITIONS( -D${BBTK_PACKAGE_NAME}_VERSION=${BBTK_PACKAGE_VERSION}) + #---------------------------------------------------------------------------- + + + #--------------------------------------------------------------------------- + # Recurse into subdirs + SUBDIRS(src) +# SUBDIRS(doc) +# SUBDIRS(bbs) #--------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# DEFINES ${PACKAGE_NAME}_AUTHOR -# ADD_DEFINITIONS( -D${PACKAGE_NAME}_AUTHOR="${PACKAGE_AUTHOR}") -#---------------------------------------------------------------------------- -#---------------------------------------------------------------------------- -# DEFINES ${PACKAGE_NAME}_DESCRIPTION -# ADD_DEFINITIONS( -D${PACKAGE_NAME}_DESCRIPTION="${PACKAGE_DESCRIPTION}") -#---------------------------------------------------------------------------- -#---------------------------------------------------------------------------- -# DEFINES ${BBTK_PACKAGE_NAME}_VERSION -SET(BBTK_PACKAGE_VERSION - "${BBTK_PACKAGE_MAJOR_VERSION}.${BBTK_PACKAGE_MINOR_VERSION}.${BBTK_PACKAGE_BUILD_VERSION}") -#ADD_DEFINITIONS( -D${BBTK_PACKAGE_NAME}_VERSION=${BBTK_PACKAGE_VERSION}) -#---------------------------------------------------------------------------- - +#--------------------------------------------------------------------------- +ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}) +#----------------------------------------------------------------------------- +# EOF +#----------------------------------------------------------------------------- diff --git a/kernel/cmake/BBTKConfigurePackage_doc.cmake b/kernel/cmake/BBTKConfigurePackage_doc.cmake index bd7f771..dbfa540 100644 --- a/kernel/cmake/BBTKConfigurePackage_doc.cmake +++ b/kernel/cmake/BBTKConfigurePackage_doc.cmake @@ -1,128 +1,151 @@ - #---------------------------------------------------------------------------- - - - - IF(BUILD_bbtk_DOC_DOXYGEN) - FIND_PACKAGE(Doxygen) - IF(DOXYGEN) - # Build the package documentation - SET(DOXYGEN_HTML_OUTPUT "html") - SET(DOXYGEN_LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/bbtk_${BBTK_PACKAGE_NAME}_Doxygen.log") - - # Input : Sources - SET(DOXYGEN_INPUT - ${DOXYGEN_INPUT} - ${PROJECT_SOURCE_DIR}/src/packages/${BBTK_PACKAGE_NAME} - ) - - STRING(REGEX REPLACE ";" " " DOXYGEN_INPUT "${DOXYGEN_INPUT}") - - # Output dir - SET(DOXYGEN_OUTPUT - ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/) - - # Doc exclude - SET(DOXYGEN_EXCLUDE "") - STRING(REGEX REPLACE ";" " " DOXYGEN_EXCLUDE "${DOXYGEN_EXCLUDE}") - - # Predefined symbols - SET(DOXYGEN_PROJECT_NAME "BBTK ${BBTK_PACKAGE_NAME} BBTK_PACKAGE") - - STRING(REGEX REPLACE ";" " " DOXYGEN_DOC_PREDEFINED "${DOXYGEN_DOC_PREDEFINED}") - - #----------------------------------------------------------------------------- - # DOT verification - - IF(DOT) - GET_FILENAME_COMPONENT(DOXYGEN_DOT_PATH ${DOT} PATH) - SET(DOXYGEN_HAVE_DOT "YES") - ELSE(DOT) - SET(DOXYGEN_DOT_PATH "") - SET(DOXYGEN_HAVE_DOT "NO") - ENDIF(DOT) - - #----------------------------------------------------------------------------- - # Create file and project - CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Doxyfile.txt - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.txt - IMMEDIATE - ) - - ADD_CUSTOM_COMMAND( - OUTPUT ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/html/index.html - COMMAND - ${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.txt - DEPENDS bb${BBTK_PACKAGE_NAME} - ) - - ADD_CUSTOM_TARGET(doxygen-bbtk-${BBTK_PACKAGE_NAME} ALL - DEPENDS ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/html/index.html - ) - ELSE(DOXYGEN) - MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation") - ENDIF(DOXYGEN) - - ENDIF(BUILD_bbtk_DOC_DOXYGEN) - - - - - #---------------------------------------------------------------------------- - # bbdoc - #--------------------------------------------------------------------------- - IF(BUILD_bbtk_DOC_BBTK_PACKAGE) +#--------------------------------------------------------------------------- +# If not a core package +# set the build doc option +# and include necessary cmake scripts +IF(NOT BBTK_CORE_PACKAGE) +## TO DO +# INCLUDE(${BBTK_DIR}/BBTKMacros.cmake) +# INCLUDE(${BBTK_DIR}/BBTKFindLibraries.cmake) +# etc. +OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_HTML_DOC + "Build the bbtk package ${BBTK_PACKAGE_NAME} html documentation ?" OFF) +SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_HTML_DOC) +IF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_HTML_DOC) + SET(BUILD_bbtk_DOC_BBTK_PACKAGE ON) + # INCLUDE +ENDIF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_HTML_DOC) + +OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_DOXYGEN_DOC + "Build the bbtk package ${BBTK_PACKAGE_NAME} doxygen documentation ?" OFF) +SWITCH_ON_IF_BUILD_ALL(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_DOXYGEN_DOC) +IF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_DOXYGEN_DOC) + SET(BUILD_bbtk_DOC_DOXYGEN ON) + # INCLUDE +ENDIF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_DOXYGEN_DOC) +ENDIF(NOT BBTK_CORE_PACKAGE) +#--------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- + + + +IF(BUILD_bbtk_DOC_DOXYGEN) + SUBDIRS(doxygen) + + # Input : Sources + SET(DOXYGEN_INPUT + ${DOXYGEN_INPUT} + ${PROJECT_SOURCE_DIR}/src/packages/${BBTK_PACKAGE_NAME} + ) - # MARK_AS_ADVANCED( bbdoc_PATH ) - - FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc/packages) - FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}) - - - IF(WIN32) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - SET(bbdoc_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/$(IntDir)/bbdoc.exe) - ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - SET(bbdoc_EXECUTABLE $(SolutionDir)/bin/$(OutDir)/bbdoc.exe) - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - ELSE(WIN32) - SET(bbdoc_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/bbdoc) - ENDIF(WIN32) - -# NEVER USE CONFIGURATION FILE BUT ALWAYS BUILD WITH THE JUST COMPILED LIBS -# NOT THE INSTALLED ONES ! - # IF(-bbtk_USE_CONFIGURATION_FILE) - # just pass the package name, not the full path name! - # and pass the option '1' to bbdoc to use config file - # SET(bbdoc_INPUT ${BBTK_PACKAGE_NAME} 1) - # ELSE(-bbtk_USE_CONFIGURATION_FILE) - - - - IF(WIN32) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - SET(bbdoc_INPUT ${EXECUTABLE_OUTPUT_PATH}/$(IntDir)/${BBTK_PACKAGE_NAME}) - ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - SET(bbdoc_INPUT $(SolutionDir)/bin/$(OutDir)/${BBTK_PACKAGE_NAME}) - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") - ELSE(WIN32) - SET(bbdoc_INPUT ${LIBRARY_OUTPUT_PATH}/${BBTK_PACKAGE_NAME}) - ENDIF(WIN32) - # ENDIF(-bbtk_USE_CONFIGURATION_FILE) + STRING(REGEX REPLACE ";" " " DOXYGEN_INPUT "${DOXYGEN_INPUT}") + + # Output dir + SET(DOXYGEN_OUTPUT + ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/) + + # Doc exclude + SET(DOXYGEN_EXCLUDE "") + STRING(REGEX REPLACE ";" " " DOXYGEN_EXCLUDE "${DOXYGEN_EXCLUDE}") + + # Predefined symbols + SET(DOXYGEN_PROJECT_NAME "BBTK ${BBTK_PACKAGE_NAME} BBTK_PACKAGE") + + STRING(REGEX REPLACE ";" " " DOXYGEN_DOC_PREDEFINED "${DOXYGEN_DOC_PREDEFINED}") + + #----------------------------------------------------------------------------- + # DOT verification + + IF(DOT) + GET_FILENAME_COMPONENT(DOXYGEN_DOT_PATH ${DOT} PATH) + SET(DOXYGEN_HAVE_DOT "YES") + ELSE(DOT) + SET(DOXYGEN_DOT_PATH "") + SET(DOXYGEN_HAVE_DOT "NO") + ENDIF(DOT) + + #----------------------------------------------------------------------------- + # Create file and project + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Doxyfile.txt + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.txt + IMMEDIATE + ) - ADD_CUSTOM_COMMAND( - OUTPUT ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html + OUTPUT ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/html/index.html COMMAND - ${bbdoc_EXECUTABLE} ${bbdoc_INPUT} ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html - DEPENDS - bb${BBTK_PACKAGE_NAME} - ${bbdoc_EXECUTABLE} - ) + ${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.txt + DEPENDS bb${BBTK_PACKAGE_NAME} + ) - ADD_CUSTOM_TARGET(${BBTK_PACKAGE_NAME}.html ALL - DEPENDS ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html) - - ENDIF(BUILD_bbtk_DOC_BBTK_PACKAGE) + ADD_CUSTOM_TARGET(doxygen-bbtk-${BBTK_PACKAGE_NAME} ALL + DEPENDS ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/html/index.html + ) + ELSE(DOXYGEN) + MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation") + ENDIF(DOXYGEN) + +ENDIF(BUILD_bbtk_DOC_DOXYGEN) + + + + +#---------------------------------------------------------------------------- +# bbdoc +#--------------------------------------------------------------------------- +IF(BUILD_bbtk_DOC_BBTK_PACKAGE) + # MARK_AS_ADVANCED( bbdoc_PATH ) + FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc/packages) + FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}) + + + IF(WIN32) + IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + SET(bbdoc_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/$(IntDir)/bbdoc.exe) + ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + SET(bbdoc_EXECUTABLE $(SolutionDir)/bin/$(OutDir)/bbdoc.exe) + ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + ELSE(WIN32) + SET(bbdoc_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/bbdoc) + ENDIF(WIN32) + + # NEVER USE CONFIGURATION FILE BUT ALWAYS BUILD WITH THE JUST COMPILED LIBS + # NOT THE INSTALLED ONES ! + # IF(-bbtk_USE_CONFIGURATION_FILE) + # just pass the package name, not the full path name! + # and pass the option '1' to bbdoc to use config file + # SET(bbdoc_INPUT ${BBTK_PACKAGE_NAME} 1) + # ELSE(-bbtk_USE_CONFIGURATION_FILE) + + + + IF(WIN32) + IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + SET(bbdoc_INPUT ${EXECUTABLE_OUTPUT_PATH}/$(IntDir)/${BBTK_PACKAGE_NAME}) + ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + SET(bbdoc_INPUT $(SolutionDir)/bin/$(OutDir)/${BBTK_PACKAGE_NAME}) + ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + ELSE(WIN32) + SET(bbdoc_INPUT ${LIBRARY_OUTPUT_PATH}/${BBTK_PACKAGE_NAME}) + ENDIF(WIN32) + # ENDIF(-bbtk_USE_CONFIGURATION_FILE) + + + ADD_CUSTOM_COMMAND( + OUTPUT ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html + COMMAND + ${bbdoc_EXECUTABLE} ${bbdoc_INPUT} ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html + DEPENDS + bb${BBTK_PACKAGE_NAME} + ${bbdoc_EXECUTABLE} + ) + + ADD_CUSTOM_TARGET(${BBTK_PACKAGE_NAME}.html ALL + DEPENDS ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html) + +ENDIF(BUILD_bbtk_DOC_BBTK_PACKAGE) + + diff --git a/kernel/cmake/BBTKConfigurePackage_src.cmake b/kernel/cmake/BBTKConfigurePackage_src.cmake index 43179ea..ab6cfbd 100644 --- a/kernel/cmake/BBTKConfigurePackage_src.cmake +++ b/kernel/cmake/BBTKConfigurePackage_src.cmake @@ -15,7 +15,10 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_BINARY_DIR}/bb${BBTK_PACKAGE_NAME}Package.h @ONLY IMMEDIATE ) -INSTALL_FILES(/include/bb${BBTK_PACKAGE_NAME} FILES bb${BBTK_PACKAGE_NAME}Package.h) +INSTALL_FILES( + /include/bb${BBTK_PACKAGE_NAME} + FILES + bb${BBTK_PACKAGE_NAME}Package.h) #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- @@ -63,26 +66,20 @@ FOREACH(xmlfile ${BBTK_PACKAGE_XML_SOURCES}) GET_FILENAME_COMPONENT(filename "${xmlfile}" NAME_WE) - IF(WIN32) - SET(bbfy_EXECUTABLE $(TargetDir)/bbfy.exe) - ELSE(WIN32) - SET(bbfy_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/bbfy) - ENDIF(WIN32) - - IF(BBFY_DEPENDENCY) - SET(BBFY_DEPENDENCY_STR ${bbfy_EXECUTABLE}) - ENDIF(BBFY_DEPENDENCY) + # IF(BBFY_DEPENDENCY) + # SET(BBFY_DEPENDENCY_STR ${bbfy_EXECUTABLE}) + # ENDIF(BBFY_DEPENDENCY) SET(BBFY_CXX_OUT ${CMAKE_CURRENT_BINARY_DIR}/${filename}.cxx) ADD_CUSTOM_COMMAND( OUTPUT ${BBFY_CXX_OUT} COMMAND - ${bbfy_EXECUTABLE} ${xmlfile} ${CMAKE_CURRENT_BINARY_DIR}/ -q + ${BBTK_BBFY} ${xmlfile} ${CMAKE_CURRENT_BINARY_DIR}/ -q DEPENDS ${xmlfile} # LG : REMOVE AUTOMATIC DEPEDENCY ON bbfy BECAUSE CAUSED ALWAYS REBUILD xml BOXES WHEN bbtk CHANGED HENCE bbfy CHANGED ${BBFY_DEPENDENCY_STR} - #${bbfy_EXECUTABLE} + #${BBTK_BBFY} ) SET_SOURCE_FILES_PROPERTIES( @@ -98,6 +95,7 @@ FOREACH(xmlfile ${BBTK_PACKAGE_XML_SOURCES}) ENDIF(NOT BBTK_PACKAGE_CXX_SOURCES MATCHES "${filename}") INSTALL_FILES(/include/bb${BBTK_PACKAGE_NAME} FILES ${filename}.h) + ENDFOREACH(xmlfile) #---------------------------------------------------------------------------- @@ -110,7 +108,6 @@ ADD_LIBRARY(bb${BBTK_PACKAGE_NAME} SHARED ) TARGET_LINK_LIBRARIES(bb${BBTK_PACKAGE_NAME} bbtk - # ${BBP_LINK_LIBRARIES} ${BBTK_PACKAGE_LIBS} ) #---------------------------------------------------------------------------- diff --git a/kernel/cmake/BBTKFindLibraries.cmake b/kernel/cmake/BBTKFindLibraries.cmake index 96ff1c8..4b73164 100644 --- a/kernel/cmake/BBTKFindLibraries.cmake +++ b/kernel/cmake/BBTKFindLibraries.cmake @@ -177,3 +177,37 @@ SET(BBTK_WXWIDGETS_LIBRARIES ENDIF(USE_WXWIDGETS) #----------------------------------------------------------------------------- + + + +#----------------------------------------------------------------------------- +IF(USE_DOXYGEN) + FIND_PACKAGE(Doxygen REQUIRED) +# MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN}") + # IF(DOXYGEN) +# +# ELSE(DOXYGEN) +# MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation") +# ENDIF(DOXYGEN) +ENDIF(USE_DOXYGEN) +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +IF(USE_LATEX) + FIND_PACKAGE(LATEX REQUIRED) + MESSAGE(STATUS "Looking for latex... - found ${LATEX_COMPILER}") +ENDIF(USE_LATEX) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +IF(USE_TTH) + FIND_FILE(LATEX_tth_CONVERTER NAME tth tth.exe PATHS . c:/Creatis/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux) + IF (NOT LATEX_tth_CONVERTER) + MESSAGE(FATAL_ERROR "TTH not found (LATEX_tth_CONVERTER). Required to build the HTML documentation from tex source") + ELSE (NOT LATEX_tth_CONVERTER) + MESSAGE(STATUS "Looking for tth... - found ${LATEX_tth_CONVERTER}") + ENDIF(NOT LATEX_tth_CONVERTER) + MARK_AS_ADVANCED(LATEX_tth_CONVERTER) +ENDIF(USE_TTH) +#----------------------------------------------------------------------------- diff --git a/kernel/cmake/ADD_DEF.cmake b/kernel/cmake/BBTKMacros.cmake similarity index 56% rename from kernel/cmake/ADD_DEF.cmake rename to kernel/cmake/BBTKMacros.cmake index a76413d..5fa33e4 100644 --- a/kernel/cmake/ADD_DEF.cmake +++ b/kernel/cmake/BBTKMacros.cmake @@ -1,3 +1,4 @@ + #----------------------------------------------------------------------------- # MACRO TO ADD A COMPILER DEFINITION WHICH ADDS ALSO THE DEF # INTO DOXYGEN PREDEFINED VAR @@ -31,3 +32,32 @@ MACRO(ADD_DEF_WITH_VAL DEF VAL) MARK_AS_ADVANCED(DOXYGEN_DOC_PREDEFINED) ENDMACRO(ADD_DEF_WITH_VAL) #----------------------------------------------------------------------------- + + +#======================================================================== +# MACRO WHICH COPIES ALL IMAGES (png, jpg, gif) +# FROM SOURCE TREE TO DOC BUILD TREE +# AND INSTALL THEM IN BBTK DOC TREE +MACRO(BBTK_DOC_INSTALL_IMAGES DOC_RELATIVE_INSTALL_PATH) + FILE(GLOB PNG_IMAGES "." "*.png") + FILE(GLOB JPG_IMAGES "." "*.jpg") + FILE(GLOB TIF_IMAGES "." "*.tif") + SET(IMAGES + ${PNG_IMAGES} + ${JPG_IMAGES} + ${TIF_IMAGES} + ) + FOREACH(image ${IMAGES}) + GET_FILENAME_COMPONENT(filename "${image}" NAME) + CONFIGURE_FILE( + ${image} + ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH}/${filename} + COPYONLY + ) + ENDFOREACH(image) + INSTALL( + FILES ${IMAGES} + DESTINATION ${CMAKE_INSTALL_PREFIX}/${BBTK_DOC_INSTALL_PATH}/${DOC_RELATIVE_INSTALL_PATH} + ) +ENDMACRO(BBTK_DOC_INSTALL_IMAGES) +#======================================================================== diff --git a/kernel/cmake/BBTKPaths.cmake b/kernel/cmake/BBTKPaths.cmake new file mode 100644 index 0000000..f574194 --- /dev/null +++ b/kernel/cmake/BBTKPaths.cmake @@ -0,0 +1,42 @@ +#----------------------------------------------------------------------------- +# The var BBTK_BIN_PATH +# gives the system-dependent path to output binaries +# BBTK_BBI, BBTK_BBFY and BBTK_BBDOC +# point to the system-dependent applications +# (.exe on win / no extension on lin) +IF(WIN32) + IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + SET(BBTK_BIN_PATH ${EXECUTABLE_OUTPUT_PATH}/$(IntDir)) + ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + SET(BBTK_BIN_PATH $(SolutionDir)/bin/$(OutDir)) + ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6") + SET(BBTK_BBI ${BBTK_BIN_PATH}/bbi.exe) + SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy.exe) + SET(BBTK_BBDOC ${BBTK_BIN_PATH}/bbdoc.exe) +ELSE(WIN32) + SET(BBTK_BIN_PATH ${EXECUTABLE_OUTPUT_PATH}) + SET(BBTK_BBI ${BBTK_BIN_PATH}/bbi) + SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy) + SET(BBTK_BBDOC ${BBTK_BIN_PATH}/bbdoc) +ENDIF(WIN32) + +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# The vars BBTK_DOC_INSTALL_PATH and BBTK_BBS_INSTALL_PATH +# store documentation and scripts install paths +# (different on win/lin) +IF(WIN32) + SET(BBTK_DOC_INSTALL_PATH doc) + SET(BBTK_BBS_INSTALL_PATH bbs) +ELSE(WIN32) + SET(BBTK_SHARE_INSTALL_PATH share/bbtk) + SET(BBTK_DOC_INSTALL_PATH share/bbtk/doc) + SET(BBTK_BBS_INSTALL_PATH share/bbtk/bbs) +ENDIF(WIN32) + +ADD_DEF_WITH_VAL(BBTK_DOC_REL_PATH ${BBTK_DOC_INSTALL_PATH}) +ADD_DEF_WITH_VAL(BBTK_BBS_REL_PATH ${BBTK_BBS_INSTALL_PATH}) + +MESSAGE(STATUS "doc='${BBTK_DOC_INSTALL_PATH}'") +#----------------------------------------------------------------------------- diff --git a/kernel/doc/CMakeLists.txt b/kernel/doc/CMakeLists.txt new file mode 100755 index 0000000..73e04d5 --- /dev/null +++ b/kernel/doc/CMakeLists.txt @@ -0,0 +1,131 @@ + +#----------------------------------------------------------------------------- +IF(UNIX) + # Make symbolic links to get doc links work in build tree + IF(NOT IS_DIRECTORY ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}) + FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/${BBTK_SHARE_INSTALL_PATH}) + EXECUTE_PROCESS( + COMMAND ln -s ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}) +# EXECUTE_PROCESS( +# COMMAND ln -s ${CMAKE_CURRENT_BINARY_DIR}/.. ${PROJECT_BINARY_DIR}/${BBTK_BBS_INSTALL_PATH}) + ENDIF(NOT IS_DIRECTORY ${PROJECT_BINARY_DIR}/${BBTK_DOC_INSTALL_PATH}) +ENDIF(UNIX) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +OPTION(BUILD_bbtk_DOC "Build documentation for bbtk." OFF) +SWITCH_ON_IF_BUILD_ALL(BUILD_bbtk_DOC) +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +IF(BUILD_bbtk_DOC) + + OPTION(BUILD_bbtk_DOC_PACKAGE + "Build bbtk packages documentation (bbi)." ON) + OPTION(BUILD_bbtk_DOC_DOXYGEN + "Build doxygen documentation (doxygen)." ON) + OPTION(BUILD_bbtk_DOC_GUIDES_PDF + "Build bbtk Guides', PDF format (latex)." ON) + OPTION(BUILD_bbtk_DOC_GUIDES_HTML + "Build bbtk Guides', HTML format (latex+tth)." ON) + +ELSE(BUILD_bbtk_DOC) + + IF(BUILD_bbtk_DOC_PACKAGE) + SET(BUILD_bbtk_DOC_PACKAGE OFF CACHE BOOL + "Build bbtk packages documentation (bbdoc)." FORCE) + ENDIF(BUILD_bbtk_DOC_PACKAGE) + IF(BUILD_bbtk_DOC_DOXYGEN) + SET(BUILD_bbtk_DOC_DOXYGEN OFF CACHE BOOL + "Build doxygen documentation. (doxygen)" FORCE) + ENDIF(BUILD_bbtk_DOC_DOXYGEN) + + IF(BUILD_bbtk_DOC_GUIDES_PDF) + SET(BUILD_bbtk_DOC_GUIDES_PDF OFF CACHE BOOL + "Build bbtk Guides', PDF format (latex)." FORCE) + ENDIF(BUILD_bbtk_DOC_GUIDES_PDF) + + IF(BUILD_bbtk_DOC_GUIDES_HTML) + SET(BUILD_bbtk_DOC_GUIDES_HTML OFF CACHE BOOL + "Build bbtk Guides', HTML format (latex tth)." FORCE) + ENDIF(BUILD_bbtk_DOC_GUIDES_HTML) +# IF(BUILD_bbtk_DOC_SCRIPTS) +# SET(BUILD_bbtk_DOC_SCRIPTS_HTML OFF CACHE BOOL +# "Build bbtk scripts documentation (bbi+dot)." FORCE) +# ENDIF(BUILD_bbtk_DOC_SCRIPTS) + +ENDIF(BUILD_bbtk_DOC) + + +#----------------------------------------------------------------------------- + +IF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_DOXYGEN) + INCLUDE(../cmake/BBTKBuildDoxygenDoc.cmake) + SUBDIRS(bbtkDoxygen) +ENDIF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_DOXYGEN) +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +IF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_PDF) + INCLUDE(../cmake/BBTKBuildLatexDoc.cmake) +ELSE(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_HTML) + MACRO(BBTK_BUILD_LATEX_DOC TEX_FILE) + ENDMACRO(BBTK_BUILD_LATEX_DOC) +ENDIF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_PDF) +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +IF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_HTML) + INCLUDE(../cmake/BBTKBuildHtmlDocFromLatex.cmake) +ELSE(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_HTML) + MACRO(BBTK_BUILD_HTML_DOC_FROM_LATEX SOURCE) + ENDMACRO(BBTK_BUILD_HTML_DOC_FROM_LATEX) +ENDIF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_HTML) +ENDIF(BUILD_bbtk_DOC_GUIDES_PDF) +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +IF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_PDF OR BUILD_bbtk_DOC_GUIDES_HTML) + SUBDIRS(bbtkUsersGuide) + SUBDIRS(bbtkPackageDevelopersGuide) + SUBDIRS(bbtkDevelopersGuide) +ENDIF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_GUIDES_PDF OR BUILD_bbtk_DOC_GUIDES_HTML) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +#IF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_SCRIPTS) +# SUBDIRS(scripts) +#ENDIF(BUILD_bbtk_DOC AND BUILD_bbtk_DOC_SCRIPTS) +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +# Web site +IF(BUILD_bbtk_DOC) + # Configure doc index.html for build tree doc + CONFIGURE_FILE( + index.html + ${CMAKE_CURRENT_BINARY_DIR}/index.html + @ONLY + ) + # Install + INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/index.html + DESTINATION ${CMAKE_INSTALL_PREFIX}/${BBTK_DOC_INSTALL_PATH} + ) + SUBDIRS(bbtkWebSite) + INSTALL( + DIRECTORY ${BBTK_BINARY_DIR}/kernel/doc + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) +ENDIF(BUILD_bbtk_DOC) +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Creates the packages subdir +#FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/packages) +#----------------------------------------------------------------------------- diff --git a/kernel/doc/bbtkDevelopersGuide/CMakeLists.txt b/kernel/doc/bbtkDevelopersGuide/CMakeLists.txt new file mode 100755 index 0000000..61cbc10 --- /dev/null +++ b/kernel/doc/bbtkDevelopersGuide/CMakeLists.txt @@ -0,0 +1,3 @@ +BBTK_DOC_INSTALL_IMAGES(bbtkDevelopersGuide) +BBTK_BUILD_LATEX_DOC(bbtkDevelopersGuide) +BBTK_BUILD_HTML_DOC_FROM_LATEX(bbtkDevelopersGuide) diff --git a/kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex b/kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex new file mode 100644 index 0000000..0de7e4e --- /dev/null +++ b/kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex @@ -0,0 +1,46 @@ +\documentclass[a4paper,11pt]{report} +\input{config.tex} +\author{L. Guigues} +\title{The Black Box Tool Kit\\Developers' Guide} + +\begin{document} +\maketitle +\tableofcontents +\chapter{Introduction} + + +\chapter{Misc} +\section{Displaying messages} + +\section{Types and RTTI} + + + +In \bbtk the class conveying the information on a type is +\begin{verbatim} +bbtk::TypeInfo +\end{verbatim} +which is simply a typedef on +\begin{verbatim} +const std::type_info& +\end{verbatim} +Remember that all constructors ofthe std::type\_info class are private, +hence objects can only be created by the operator \texttt{typeid} +which returns a const reference on a type\_info. +Hence the \bbtk type TypeInfo conveys that const reference +and cannot be itself referenced. +Any function or method which takes or returns a TypeInfo must take +or return it \emph{by value} (see e.g. the TypeName function below). +To print the name of a type use one of the template functions +\begin{verbatim} +template std::string TypeName(); +template std::string TypeName(const T&); +template std::string TypeName(bbtk::TypeInfo); +\end{verbatim} + + +\begin{verbatim} +BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::string,"string"); +\end{verbatim} + +\end{document} diff --git a/kernel/doc/bbtkDevelopersGuide/naming_conventions.txt b/kernel/doc/bbtkDevelopersGuide/naming_conventions.txt new file mode 100644 index 0000000..f84f404 --- /dev/null +++ b/kernel/doc/bbtkDevelopersGuide/naming_conventions.txt @@ -0,0 +1,81 @@ +* cmake : PACKAGE_NAME : std, itk, vtk +(nom bbi ; utilisé par load) + +* librairie créée : bbstd.dll / libbbstd.so, etc. + bb.dll / libbb.so + +* Sources : + Type de boite appelé BOX_TYPE_NAME (i.e. dans bbi "new BOX_TYPE_NAME a") + - bb.h / .cxx / .xml + Ex : bbstdCast.h + + dans bb.h : + * Symbole de blockage : __bb_h_INCLUDED__ + ex : #ifndef __bbstdCast_h_INCLUDED__ + #define __bbstdCast_h_INCLUDED__ + ... + #endif // __bbstdCast_h_INCLUDED__ + + + * Namespace : bb + ex : + namespace bbstd + { + ... + } // namespace bbstd + + * Classe + ex : + class Cast : public bbtk::UserBlackBox + { + }; // class Cast + * Descriptor : + BEGIN_DESCRIBE_BLACK_BOX(,parent) + ... + BBTK_NAME() + ... + END_DESCRIBE_BLACK_BOX(,parent) + + * Utilisation : si on a la boite B definie dans package P1 et dans package P2 + * Utilisation c++ : + #include "bbstdCast.h" + #include "bbP1B.h" + #include "bbP2B.h" + main() + { + bbtk::BlackBox* b = new bbstd::Cast("b"); + bbtk::BlackBox* c = new bbP1::B("c"); + bbtk::BlackBox* d = new bbP2::B("d"); + } + + * Utilisation bbi : + >load std + >load P1 + >load P2 + >new Cast b + >new B c + ERROR : A black box of type B exists in packages P1 and P2. Do you mean P1::B or P2::B ? + >new P1::B c + >new P2::B d + // THIS IS OK + >help P1 + Package P1 v1.0.0 - foo.bar at corp.com + My marvelous package + Black boxes : + B : Uncompress a file in jpeg format + >help P2 + Package P2 v1.0.0 - bar.foo at expat.co + I made this package for fun + Black boxes : + B : Automatic scientific article generator + >help B + ERROR : A black box of type B exists in packages P1 and P2. Do you mean P1::B or P2::B ? + >help P1::B + Black box + Uncompress a file in jpeg format + By : foo.bar at corp.com + * Inputs : + ... + + + diff --git a/kernel/doc/bbtkDoxygen/CMakeLists.txt b/kernel/doc/bbtkDoxygen/CMakeLists.txt new file mode 100755 index 0000000..1e183f2 --- /dev/null +++ b/kernel/doc/bbtkDoxygen/CMakeLists.txt @@ -0,0 +1,21 @@ + +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/CodingStyle.html + ${CMAKE_CURRENT_BINARY_DIR}/CodingStyle.html + IMMEDIATE + ) +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/DoxyMainPage.txt + ${CMAKE_CURRENT_BINARY_DIR}/DoxyMainPage.txt + IMMEDIATE + ) + +SET(INPUT + ${CMAKE_CURRENT_BINARY_DIR}/DoxyMainPage.txt + ${PROJECT_SOURCE_DIR}/kernel/src + ${PROJECT_SOURCE_DIR}/kernel/appli + ) + +INCLUDE(${BBTK_DIR}/BBTKBuildDoxygenDoc.cmake) +BBTK_BUILD_DOXYGEN_DOC("BBTK" "${INPUT}" "bbtkDoxygen" "${DOXYGEN_DOC_PREDEFINED}") + diff --git a/kernel/doc/bbtkDoxygen/CodingStyle.html b/kernel/doc/bbtkDoxygen/CodingStyle.html new file mode 100644 index 0000000..57758d7 --- /dev/null +++ b/kernel/doc/bbtkDoxygen/CodingStyle.html @@ -0,0 +1,360 @@ + + + bbtk Developpers + + + + +

bbtk coding style (and other religious/agnostic beliefs)

+
+ +
* Introduction:
+   The following coding style intends to ease the work of developpers
+   themselves but also of users who will study, maintain, fix, and extend
+   the code. Any bread crumbs that you can drop in the way of explanatory
+   names and comments will go a long way towards helping other readers and
+   developers.
+   Keep in mind that to a large extent the structure of code directly
+   expresses its implementation.
+                                                                                
+* Language:
+ - C++ (for the kernel) and Python (for the wrappers).
+ - all the names (variables, members, methods, functions) and comments
+   should be based on English. Documentation, guides, web site and other
+   informations should be in English.
+   Make sure you use correct (basic) English and complete, grammatically
+   correct sentences for comments and documentation.
+                                                                                
+* General layout:
+ - Each line of code should take no more than 79 characters. Break the code
+   across multiple lines as necessary.
+ - Methods and functions should keep a reasonable number of lines when
+   possible (a typical editor displays 50 lines). Avoid code duplication.
+   Always prefer creating a new method or function to duplication.
+   A high indentation level generally suggests the need for a new
+   method or function.
+ - All the code should be properly indented. The appropriate indentation
+   level is TWO spaces for each level of indentation. DO NOT USE TABS.
+   Set up your editor to insert spaces. Using tabs may look good in your
+   editor but will wreak havoc in others, or in external tools (e.g. side
+   by side diffs).
+ - The declaration of variables within classes, methods, and functions
+   should be one declaration per line. Provide them with default values
+   and don't rely on compilers for default initialization.
+                                                                                
+* Naming conventions:
+ - Generalities:
+   In general, names are constructed by using case change to indicate
+   separate words, as in ImageDataSize (standing for "image data size").
+   Underscores are not used. Variable names are choosen carefully with the
+   intention to convey the meaning behind the code. Names are generally
+   spelled out; use of abbreviations is discouraged.
+   [Note: abbreviation are allowable when in common use, and should be in
+    uppercase as in LUT or RGBA.]
+   While this does result in long names, it self-documents the code.
+ - Naming Files:
+   Files should have the same name as the class, with a "bbtk" prepended.
+   Header files are named .h, while implementation files are named either
+   .cxx or .txx, depending on whether they are implementations of templated
+   classes. For example, the class bbtk::BlackBox is declared and defined
+   in the files bbtkBlackBox.h and bbtkBlackBox.cxx.
+ - Naming Class Data Members, Methods, and Functions:
+   Class data members (aka Attributes) are named beginning with a lower case 'm'
+   (m as 'member'!) followed by capital letter as in mGroupPixel, in order not
+   be confused with methods names.
+   Global functions and class methods, either static or class members, are
+   named beginning with a capital letter, as in GetImageDataSize().
+ - Naming Local Variables:
+   Local variables begin in lowercase. There is more flexibility in the
+   naming of local variables although they still should convey some
+   semantics.
+ - Naming function parameters:
+   Function parameters begin in lowercase. There is more flexibility in the
+   naming of function parameters although they still should convey some
+   semantics.
+                                                                                 
+* Classes:
+ - Don't use the inline keyword when defining an inline function
+   within a class definition.
+   (Any method defined within a .h file is ipso facto considered as 'inline'.
+   Dont write useless stuff!)
+ - As stated in the "Naming conventions" section, class data members
+   named beginning with a lower case 'm' followed by capital letter 
+   as in mGroupPixel.
+   But the parameter names of method should be named with a lowercase
+   letter (in order to distinguish at a glance data members, from parameters
+   and also to avoid potential collisions with data members):
+      void A::SetGroupPixel( int groupPixel )
+      {
+         mGroupPixel = groupPixel;
+      }
+ - Don't use trailing ';' in inline function definition.
+   use :
+   void A::SetGroupPixel( int groupPixel ){mGroupPixel = groupPixel;}
+     NOT
+   void A::SetGroupPixel( int groupPixel ){mGroupPixel = groupPixel;};
+ - Do not repeat the 'virtual' keyword when overriding virtual base methods
+   in declaration of subclasses:
+     class A
+     {
+        virtual void foo(...);
+     };
+     class B : public bbtk::A
+     {
+        void foo(...);          // and NOT: virtual void foo(...);
+     };
+     
+    (when the keyword 'virtual' is used at the parent level, it's propagated 
+     for all the child classes)
+
+ - In declaration of subclasses, always preprend the class name with 'bbtk::'
+   in order not to confuse Umbrello ( OpenSource UML diagram generator)
+     class A
+     {
+        ...
+     };
+     class B : public bbtk::A // and NOT: class B: public A
+     {
+        ...   
+     };    
+ - The public, protected, private declarations should be at the
+   same indent level as the class. Use :
+     class A
+     {
+     public:
+        void bar(...);
+     protected:
+        void foo(...);	
+     private:
+        void pff(...);
+     };
+     
+ - The Data members should be declared at the end of the class declaration :
+     class A
+     {
+     public:
+        void bar(...);
+     protected:
+        void foo(...);
+     private:
+        void pff(...);
+
+     // --- Data members
+     
+     public:
+        int mPublicCounter;
+     protected:
+        int mProtectedCounter;
+     private:
+        int mPrivateCounter;     
+     }; 
+ 
+ - Method and functions devoided of arguments should not use the void
+   notation. Use :
+     SomeType Header::GetPixelData()
+   and not
+     SomeType Header::GetPixelData(void)
+                                                                                
+* Use of braces:
+ - Braces must be used to delimit the scope of an if, for, while, switch, or
+   other control structure. Braces are placed on a line by themselves, and
+   at the same indentation level as the control structure to which they
+   belong:
+      for (i=0; * i<3; i++)
+      {
+         ...
+      }
+   and NOT :
+      for (i=0; * i<3; i++) {
+         ...
+      }   
+   or when using an if:
+      if ( condition )
+      {
+         ...
+      }
+      else if ( other condition )
+      {
+         ...
+      }
+      else
+      {
+        ....
+      }
+    and NOT :
+      if ( condition ) {
+         ...
+      } else if ( other condition ) {
+         ...
+      } else {
+         ....
+      }    
+   You can choose to use braces on a line with a code block when
+   the block consists of a single line:
+      if ( condition ) { foo=1; }
+      else if ( condition2 ) { foo=3; }
+      else { return; }
+   or
+      for (i=0; i<3; ++i) {x[i]=0.0;}
+   Methods and functions should follow the same usage of braces:
+      void File::ParsePixelData()
+      {
+         ...
+      }
+
+* Special layout:
+ - Avoid code mixed with comments on a single line. Instead, prepend the
+   logical blocks of code with the concerned comments.
+ - Use parentheses around conditions e.g. with an if statement:
+      if ( someLocalVariable == 2 ) { ... }
+ - Add spaces around parentheses, or braces. Use
+      if ( someLocalVariable == 2 ) { mClassMember += 1; }
+   and not
+      if (someLocalVariable == 2) {mClassMember += 1;}
+ - Add spaces around each side of the assignement operator, and
+   around binary operators used in boolean expression. Use
+      someLocalVariable = mClassMember * 2;
+      if ( someLocalVariable == 2 || mClassMember == 2 ) ...
+   and not
+      someLocalVariable=mClassMember*2;
+      if ( someLocalVariable==2||mClassMember==2 ) ...
+                                                                                
+* Miscelaneous:
+ - Don't use underscores. Don't use tabs. Don't use control characters
+   like ^M. Anyhow, cvs is configured to reject such commits.
+ - Comments should be in C++ style ("// ...", two slashes, per line). Don't
+   use C style comments ("/* ... */").
+ - The last line of a file should terminate with "\n".
+ - Returned arguments of methods and functions should not be wrapped with
+   parentheses. Use
+      return iter->second;
+   but do not use
+      return ( iter->second );
+                                                                                
+* Debugging and Verbose modes:
+   Never use std::cout. Instead use the bbtkMessage, bbtkDebugMessage, bbtkWarning or bbtkError macros and their variants. Example:
+      #include "bbtkMessageManager.h"
+      ...
+      {
+         bbtkDebugMessageInc("MyClass",9,"Local function name: entering.");
+         ...
+         bbtkDecTab("MyClass",9);
+      }
+    will send the message to std::cout when the Debug messages are compiled 
+    and the Message Level for the category of messages "MyClass" is greater than 9.
+                                                                                
+* Documentation:
+   The Doxygen open-source system is used to generate on-line documentation.
+   Doxygen requires the embedding of simple comments in the code which is in
+   turn extracted and formatted into documentation. See :
+      http://www.stack.nl/~dimitri/doxygen/
+   for more information about Doxygen.
+ - Documenting a class:
+   Classes should be documented using the class and brief doxygen commands,
+   followed by the detailed class description:
+      /**
+       * \class Header
+       * \brief Header acts as container of Dicom elements of an image.
+       *
+       * Detailed description of the class is provided here
+       * ...
+       */
+   The key here is that the comment starts with /**, each subsequent line has
+   an aligned *, and the comment block terminates with a */.
+ - Documenting class members and inline methods:
+   All the members and the inline methods should be documented within
+   the class declaration ( .h file) as shown in the following example:
+      class Header
+      {
+         /// True when parsing was successfull. False otherwise.
+         bool mReadable = false;
+                                                                                
+         /// \brief The number of lines of the image as interpreted from
+         ///        the various elements encountered at header parsing.
+         int mNumberOfLines = -1;
+                                                                                
+         /// Predicate implemented as accessor around \ref mReadable.
+         bool IsReadable() { return mReadable; }
+      };
+ - Documenting a Method:
+   Methods should be documented using the following comment block style
+   as shown in the following example:
+                                                                                
+      /**
+       * \brief  Within the Dicom Elements (parsed with the public and private
+       *         dictionaries), look for the element value representation of
+       *         a given tag.
+       * @param  group  Group number of the searched tag.
+       * @param  elem Element number of the searched tag.
+       * @return Corresponding element value representation when it exists,
+       *         and the string "bbtk::Unfound" otherwise.
+       */
+      std::string Document::GetEntryByNumber(guint16 group, guint16 elem)
+      {
+         ...
+      }
+                                                                                
+* External includes and C style:
+ - Only the C++ standard library and the STL includes should be used.
+   When including don't use the .h extension (use #include 
+   instead of #include ).
+   Note: include the stl header AFTER the bbtk ones (otherwise pragma
+         warnings won't work).
+ - Don't use the C standard library. Don't include stdio.h, ctype.h...
+   Don't use printf(), sprinf(), FILE*...
+ - Don't use the NULL notation (neither as macro, nor as const int NULL=0).
+   A pointer that doesn't refer to an object should simply be defined as
+      DataPointer *myDataPointer = 0;
+                                                                                
+* Basic types:
+ - Assume T is a given type. When declaring or defining with the
+   "pointer to T" notation, the * character must be adjacent to
+   the variable and not the type. That is use
+      T *foo = 0;
+   and not
+      T* foo = 0;
+   nor
+      T * foo = 0;
+ - Assume T is a given type. When declaring or defining with the
+   "reference to T" notation, the & character must be adjacent to
+   the variable and not the type. That is use :
+      T &foo = 0;
+   and not
+      T& foo = 0;
+
+   (Doxygen will not have any longer to correct)
+
+ - Always define a typedef for a new type and be consistent in usage.
+   Use :
+      typedef Header *HeaderPointer;
+      HeaderPointer myHeaderPointer;
+      
+ - One notorious counter example for non using C style inclusion concerns
+   exact-width integers (since there seem to be no equivalent for C++).
+   When using exact-width integers use the typedef names defined by
+   the Basic ISO C99: 7.18 Integer types i.e.
+      int8_t     int16_t     int32_t     int64_t (signed integers)
+   and
+      uint8_t    uint16_t    uint32_t    uint64_t (unsigned integers).
+   Conversion table is then:
+    unsigned char       -> uint8_t;
+    unsigned short      -> uint16_t;
+    unsigned int        -> uint32_t;
+    unsigned long       -> uint32_t;
+    unsigned long long  -> uint64_t;
+    (signed) char       -> int8_t;
+    short               -> int16_t;
+    int                 -> int32_t;
+    long                -> int32_t;
+    long long           -> int64_t;
+   Hence do not use declarations like "unsigned int".
+   With g++, accessing those typedef is achieved by the following
+      #include < stdint.h >
+
+ + + +
+ + diff --git a/kernel/doc/bbtkDoxygen/DoxyMainPage.txt b/kernel/doc/bbtkDoxygen/DoxyMainPage.txt new file mode 100755 index 0000000..94c4c71 --- /dev/null +++ b/kernel/doc/bbtkDoxygen/DoxyMainPage.txt @@ -0,0 +1,19 @@ +/** + * \mainpage bbtk documentation + +\htmlonly + +"A black box is any system in which only the input and output characteristics are of interest - without regard to its internal mechanism or structure" (from wikipedia ) + +
  • + Coding Style +
  • + +\endhtmlonly + + + + + + + */ diff --git a/kernel/doc/bbtkDoxygen/Doxyfile.txt b/kernel/doc/bbtkDoxygen/Doxyfile.txt new file mode 100755 index 0000000..0dc4306 --- /dev/null +++ b/kernel/doc/bbtkDoxygen/Doxyfile.txt @@ -0,0 +1,764 @@ +# Doxyfile 1.2.14 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. +PROJECT_NAME = @DOXYGEN_PROJECT_NAME@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. +PROJECT_NUMBER = @PROJECT_VERSION@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. +OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT@ + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, +# German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, +# Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish. +OUTPUT_LANGUAGE = English + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. +EXTRACT_LOCAL_CLASSES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these class will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. +HIDE_UNDOC_CLASSES = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +REPEAT_BRIEF = YES + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. +INLINE_INHERITED_MEMB = YES + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. It is allowed to use relative paths in the argument list. +STRIP_FROM_PATH = + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. +INTERNAL_DOCS = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. +STRIP_CODE_COMMENTS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower case letters. If set to YES upper case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# users are adviced to set this option to NO. +CASE_SENSE_NAMES = YES + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. +SHORT_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. +HIDE_SCOPE_NAMES = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. +VERBATIM_HEADERS = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put list of the files that are included by a file in the documentation +# of that file. +SHOW_INCLUDE_FILES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explict @brief command for a brief description. +JAVADOC_AUTOBRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# reimplements. +INHERIT_DOCS = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. +SORT_MEMBER_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. +TAB_SIZE = 8 + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. +GENERATE_BUGLIST = YES + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. +ALIASES = + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consist of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. +MAX_INITIALIZER_LINES = 30 + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance some of the names that are used will be different. The list +# of all members will be omitted, etc. +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, then doxygen will generate warnings +# for error documented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. +WARN_LOGFILE = @DOXYGEN_LOGFILE@ + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. +INPUT = @DOXYGEN_INPUT@ + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl +FILE_PATTERNS = *.h *.cxx *.txx + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +EXCLUDE = @DOXYGEN_EXCLUDE@ + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. +EXAMPLE_PATTERNS = *.cxx + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +INPUT_FILTER = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse. +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. +INLINE_SOURCES = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. +REFERENCES_RELATION = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) +COLS_IN_ALPHA_INDEX = 3 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. +HTML_OUTPUT = @DOXYGEN_HTML_OUTPUT@ + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the Html help documentation and to the tree view. +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, +# or Internet explorer 4.0+). Note that for large projects the tree generation +# can take a very long time. In such cases it is better to disable this feature. +# Windows users are probably better off using the HTML help feature. +GENERATE_TREEVIEW = YES + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. +LATEX_OUTPUT = latex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. +LATEX_BATCHMODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimised for Word 97 and may not look very pretty with +# other RTF readers or editors. +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assigments. You only have to provide +# replacements, missing definitions are set to their default value. +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. +GENERATE_XML = NO + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. +PREDEFINED = @DOXYGEN_DOC_PREDEFINED@ + + +# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line and do not end with a semicolon. Such function macros are typically +# used for boiler-plate code, and will confuse the parser if not removed. +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES tag can be used to specify one or more tagfiles. +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. Note that this +# option is superceded by the HAVE_DOT option below. This is only a fallback. It is +# recommended to install and use dot, since it yield more powerful graphs. +CLASS_DIAGRAMS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) +HAVE_DOT = @DOXYGEN_HAVE_DOT@ + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. +COLLABORATION_GRAPH = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. +TEMPLATE_RELATIONS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. +HIDE_UNDOC_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. +INCLUDED_BY_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. +GRAPHICAL_HIERARCHY = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are gif, jpg, and png +# If left blank gif will be used. +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. +DOT_PATH = "@DOXYGEN_DOT_PATH@" + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. +MAX_DOT_GRAPH_HEIGHT = 1024 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermedate dot files that are used to generate +# the various graphs. +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. +SEARCHENGINE = NO diff --git a/kernel/doc/bbtkPackageDevelopersGuide/CMakeLists.txt b/kernel/doc/bbtkPackageDevelopersGuide/CMakeLists.txt new file mode 100755 index 0000000..78998d9 --- /dev/null +++ b/kernel/doc/bbtkPackageDevelopersGuide/CMakeLists.txt @@ -0,0 +1,3 @@ +BBTK_DOC_INSTALL_IMAGES(bbtkPackageDevelopersGuide) +BBTK_BUILD_LATEX_DOC(bbtkPackageDevelopersGuide) +BBTK_BUILD_HTML_DOC_FROM_LATEX(bbtkPackageDevelopersGuide) diff --git a/kernel/doc/bbtkPackageDevelopersGuide/bbtkPackageDevelopersGuide.tex b/kernel/doc/bbtkPackageDevelopersGuide/bbtkPackageDevelopersGuide.tex new file mode 100644 index 0000000..ab4cb9f --- /dev/null +++ b/kernel/doc/bbtkPackageDevelopersGuide/bbtkPackageDevelopersGuide.tex @@ -0,0 +1,614 @@ +% ========================================== +\documentclass[11pt,final,a4paper]{article} +\input{config.tex} +\begin{document} +\title{The Black Box Toolkit\\Package Developers' Guide} +\date{\today} +\author{Laurent Guigues} +\maketitle +% ========================================== +\tableofcontents +% ========================================== + + +% ========================================== +%\section*{Abstract} +% ========================================== +\newpage +% ========================================== +% ========================================== +\vspace{0.5cm}\hrule +%\section{Creating your own black boxes} +%\label{bbp} +% ========================================== + +% ========================================== +\section{Steps in the creation of new black boxes} +% ========================================== +Any black box must be included in a \bbtk package, +that is in a particular shared library which can be loaded +dynamically by \bbtk (hence applications which use \bbtk, +such as the interpreter \bbi). + +\begin{enumerate} +\item \textbf{Create a new package. } +Before defining any black box you +have to create a package, or more precisely +the files which will allow you to generate the package +(compile and link the shared library) and may be install it. +The utility \texttt{bbCreatePackage} does it for you. + +Two cases occur : +\begin{itemize} +\item The black boxes you want to create are based on +a processing code (\CPP classes or \C functions) which +is in an existing project handled by \cmake +and you want the new package to be part of your existing project. +You will have to create your new package into the source tree of your +project. +\item You do not have an already existing project (you want +to create the new boxes from scratch) or you want/are imposed +that the existing project remain external to the package project. +You will have to create your new package in a new location and +may be include/link against existing libraries. +\end{itemize} + +\item \textbf{Describe your new box. } +You can do it either : +\begin{itemize} +\item In \CPP code. You will have to write the class for +your box, mostly using \bbtk macros. +\item In \xml code. +When configuring your project with \cmake, +the utility \bbfy will then generate the corresponding \CPP code. +\end{itemize} + +\end{enumerate} + +% ========================================== +\section{Creating a new black box package} +% ========================================== + +The utility \texttt{bbCreatePackage} allows to +create a new void package. It is a command script +(a \texttt{bash} script on linux, +a \texttt{dos} script on windows) +which creates the directory structure and the \texttt{cmake} +files necessary to build the project. + +Its usage is as follows : +\begin{verbatim} +> bbCreatePackage +\end{verbatim} + +You must then decide the name of your new package. +It will be the name used to load the package in \texttt{bbi}. + +For example, on linux, turn to an empty folder and type : + +\begin{verbatim} +> bbCreatePackage pack1 +\end{verbatim} + +you get : + +\begin{verbatim} +----- Creating new black box package in 'pack1' ----- +-> Creating directory 'pack1' +-> Creating file 'pack1/CMakeLists.txt' +-> Creating directory 'pack1/cmake' +-> Copying files in 'pack1/cmake' +Done ! +Edit the file 'pack1/CMakeLists.txt' to customize your package +\end{verbatim} + +the file tree obtained is : + +\begin{verbatim} +> tree pack1 +pack1/ +|-- CMakeLists.txt +`-- cmake + |-- Configure.cmake + |-- ConfigurePackage.cmake + |-- FindGTK2.cmake + |-- FindLibrary.cmake.in + |-- FindwxW.cmake + |-- GenerateLibraryConfig.cmake + |-- InstallLibrary.cmake + |-- LibraryConfig.cmake.in + |-- UseLibrary.cmake.in + |-- bbPackage.cxx.in + `-- bbPackage.h.in + +1 directory, 12 files +\end{verbatim} + +The directory \texttt{pack1} is the directory of your new package, +in which you will create the files describing your black boxes. +But first, you have to customize your new package, by editing the file +\texttt{CMakeLists.txt} in the \texttt{pack1} directory. +This file contains : + +\begin{file}{pack1/CMakeLists.txt} +\small +\begin{verbatim} +#........................................................................... +# CMake configuration file for a bbtk package. +# Automatically generated by bbCreatePackage. +# - The lines which are between dotted comments (#...) must be left unchanged +# - The lines which are between dashed comments (#===) can be edited to customize the package +#........................................................................... + +#........................................................................... +INCLUDE(cmake/Configure.cmake) +#........................................................................... + + +#=========================================================================== +# THE NAME OF THE PACKAGE +SET(PACKAGE_NAME Example) +#=========================================================================== + + +#........................................................................... +# DOES THE USER WANT TO BUILD THE PACKAGE ? +OPTION(BUILD_PACKAGE_${PACKAGE_NAME} + "Build the bbtk package ${PACKAGE_NAME}" ON) +#........................................................................... + +#........................................................................... +# IF THE USER HAS CHOSEN TO BUILD THE PACKAGE +IF(BUILD_PACKAGE_${PACKAGE_NAME}) + #........................................................................... + + + #=========================================================================== + # UNCOMMENT NEXT LINES IF THE PACKAGE USES THE VTK LIBRARY, THE ITK LIB, ETC. + # SET(${PACKAGE_NAME}_USE_VTK ON) + # SET(${PACKAGE_NAME}_USE_ITK ON) + # SET(${PACKAGE_NAME}_USE_GDCM ON) + # SET(${PACKAGE_NAME}_USE_GSMIS ON) + # SET(${PACKAGE_NAME}_USE_WXWIDGETS ON) + #=========================================================================== + + #=========================================================================== + # PACKAGE AUTHOR : PREFERABLY PROVIDE YOUR EMAIL ADDRESS + SET(PACKAGE_AUTHOR "foo.bar@creatis.insa-lyon.fr") + #=========================================================================== + + #=========================================================================== + # PACKAGE DESCRIPTION + SET(PACKAGE_DESCRIPTION "My marvelous black box package") + #=========================================================================== + + #=========================================================================== + # PACKAGE VERSION NUMBER + SET(PACKAGE_MAJOR_VERSION 1) + SET(PACKAGE_MINOR_VERSION 0) + SET(PACKAGE_BUILD_VERSION 0) + #=========================================================================== + + #=========================================================================== + # THE xml SOURCES OF THE PACKAGE + # EITHER UNCOMMENT NEXT LINE TO bbfy ALL .xml OF THE DIRECTORY : + SET(COMPILE_ALL_XML ON) + # ... OR LIST THE FILES TO COMPILE MANUALLY : + #SET(PACKAGE_XML_SOURCES + # LIST HERE THE FILES TO bbfy TO BUILD THE LIB + # E.G. TO bbfy "toto.xml" ADD "toto" (NO EXTENSION) + # ) + #=========================================================================== + + #=========================================================================== + # THE C++ SOURCES OF THE PACKAGE + # EITHER UNCOMMENT NEXT LINE TO COMPILE ALL .cxx OF THE DIRECTORY : + SET(COMPILE_ALL_CXX ON) + # ... OR LIST THE FILES TO COMPILE MANUALLY : + #SET(PACKAGE_CXX_SOURCES + # LIST HERE THE FILES TO COMPILE TO BUILD THE LIB + # E.G. TO COMPILE "toto.cxx" ADD "toto" (NO EXTENSION) + # ) + #=========================================================================== + + #=========================================================================== + INCLUDE_DIRECTORIES( + # LIST HERE YOUR ADDITIONAL INCLUDE DIRECTORIES (EXCEPT BBTK'S) + ) + #=========================================================================== + + #=========================================================================== + SET(PACKAGE_LIBS + # LIST HERE THE ADDITIONAL LIBS TO LINK AGAINST (EXCEPT BBTK'S) + ) + #=========================================================================== + + + #........................................................................... + INCLUDE(cmake/ConfigurePackage.cmake) + #........................................................................... + +ENDIF(BUILD_PACKAGE_\${PACKAGE_NAME}) +#........................................................................... +# EOF +#........................................................................... +\end{verbatim} +\end{file} + +The comments in the file should be easily understandable ! +You have to customize the lines which are enclosed +between dashed comment lines. +In these sections, you can set : +\begin{itemize} +\item The \textbf{name} of your package. This will be the name used to load it in \bbi. The shared library however will be called \texttt{bb}name hence on +\lin the object file will be called \texttt{libbb}name\texttt{.so} +and on \win it will be called \texttt{bb}name\texttt{.dll}. +\item The \textbf{libraries used} by the package : \vtk, \itk, \gdcm, \gsmis, \wx. The mecanisms to find these libraries, their sources and to link against them are automatically handled by the \cmake files installed by \bbCreatePackage. You just have to uncomment a line to use one of these libraries. +\item The \textbf{author(s)} of the package. Preferably provide e-mail adresses. +\item A \textbf{description} of the package, which will appear in the help of your package or in its html documentation automatically generated by \bbdoc. +\item The \textbf{version} of the package. +\item The \textbf{\xml sources} of the package : you can list each input \xml file explicitly or tell \cmake to include in the project all the \xml files of the directory. +\item The \textbf{\CPP sources} of the package : you can list each input \CPP file explicitly or tell \cmake to include in the project all the \CPP files of the directory. +\item \textbf{Additional include directories}. Set it if your package needs to include source files which are not in the package directory, typically if it depends on another library which is not one the libraries automatically handled (\vtk, \itk...). +\item \textbf{Additional libraries} to link against. Set it if your package needs to link against another library which is not one the libraries automatically handled (\vtk, \itk...). +\end{itemize} + +Of course, this is only a framework and you can add any other \cmake commands +in the file. + +% ========================================== +\section{Creating a new box} +% ========================================== + +% ========================================== +\subsection{Principles} +% ========================================== + +\subsubsection{\texttt{C++} or \texttt{XML} ?} +There are two ways to create a new black box in an existing package : +\begin{itemize} +\item Write an \xml description file which will be automatically +translated in \CPP by the \bbfy application (recommanded). +\item Write the \CPP code of the box using \bbtk macros. +\end{itemize} + +\subsubsection{From which \bbtk class inherit ?} + +Apart from this choice of the description langage to use, +there is an important choice to do concerning the implementation of the box. +In \CPP, a black box is nothing but a class which has the standard +interface of all black boxes : what's its name ? inputs ? outputs ? and so on. +The abstract description of this interface is done in the class +\texttt{bbtk::BlackBox} and is implemented in its child classes : +\texttt{bbtk::UserBlackBox} and \texttt{bbtk::WxBlackBox} +\footnote{all the classes of the \bbtk library are in a \emph{namespace} +called \texttt{bbtk} +and the \CPP header of a class called \texttt{NameOfAClass} is +in the file called \texttt{bbtkNameOfAClass.h}}. +To create a new black box, you have to inherit one of these two +concrete classes in order to inherit the black box interface and a +particular implementation of this interface. +If your black box is a \emph{Widget} black box, +that is a black box which has (or is) +a piece of a graphical interface based on the \wx library, +then it must inherit the class \texttt{bbtk::WxBlackBox}. +Concretely, a \texttt{bbtk::WxBlackBox} is associated +a \texttt{wxWindow} and must be able to return a pointer to it. +If your black box is not a widget black box, it must inherit +\texttt{bbtk::UserBlackBox}. + +\subsubsection{Inherit or encapsulate ?} + +Now, your black box will do something (hopefully !). +When you decide to write a new black box, +you should be in one of these three cases : +\begin{enumerate} +\item You already have a \texttt{C}-like function which +does the processing that you wish to 'blackboxify' +\item You already have a \CPP class which +does the processing that you wish to 'blackboxify' +\item You start from scratch without any existing code +\end{enumerate} + +The idea of \BBTK is to embed processing codes into +\CPP objects which have a standard and generic interface - +namely black boxes - to be able to chain arbitrary +processes afterwards. + +In \CPP, in order to embed an existing processing \emph{class} +into a standard interface you only have two possibilities : +\begin{enumerate} +\item {\bf Inherit} the existing processing class +\emph{and} the interface class (e.g. \texttt{bbtk::UserBlackBox}). +In this case you have to : +\begin{enumerate} +\item make the link between the inputs and outputs of the black box +and the interface of the inherited class +\item call the processing +method of the inherited class in the processing method of the black box. +\end{enumerate} +\item {\bf Encapsulate} the existing processing class +in a class inherited from +the interface class (e.g. \texttt{bbtk::UserBlackBox}). +In this case you have to : +\begin{enumerate} +\item declare it as a member of the black box, +\item instantiate it at the right time +(either in the constructor or in the processing method of the black box) +\item in the processing method of the black box : +\begin{enumerate} +\item set the inputs of the member procesing class with the inputs of the black box, +\item call the processing method of the encapsulated class +\item set the ouputs of the black box with the outputs of the encapsulated +class. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +If you wish to 'blackboxify' a C-like \emph{function}, +you do not have the choice, you can only use the second mechanism, +namely encapsulation. + +Obviously, the inheritance mechanism is more powerfull +and - when it is possible to use it - it demands less effort +because, as we will see, in \bbtk you can directly +link the accessors to the input and output data of the box +to the accessors of the inherited processing class, +as well as the procesing method of the black box +to the processing method of the inherited processing class, +very much like a callback mechanism. + +\subsubsection{Informations to provide} + +Finally, to create a new black box, you will have to give : +\begin{enumerate} +\item The {\bf name} of the box +\item The {\bf author} of the box +\item A {\bf description} of the box +\item The {\bf package} to which the box belongs (can we do it automatically ? LG : think about it) +\item Its {\bf parent black box}, either \texttt{bbtk::UserBlackBox} or \texttt{bbtk::WxBlackBox} +\item $[$Optional$]$ The additional {\bf include files} which are necessary for the code to compile (classes or functions declarations ...) +\item $[$Optional$]$ The other {\bf parent(s)} of the box (which must be known hence their header included) +\item $[$Optional$]$ The {\bf namespace} to which the box belongs +\item The box {\bf inputs} and {\bf outputs}, and for each one : +\begin{enumerate} +\item Its {\bf name} : the string which will identify the input or output +\item Its {\bf type} : any \CPP type, either a basic type or a user defined type (class ...) but which must be known, hence the necessary files must be included. +\item Its {\bf help} : a string describing the input / output +\end{enumerate} +\item Its {\bf processing} code, which can be a simple callback or an arbitrary complex code +\end{enumerate} + +\subsubsection{Input and output accessors} + +When you encapsulate a processing class or a C function +or when you write down a black box from scratch, +you must access the inputs and outputs of the black box, +in order to interface it manually with your processing method +or simply write your processing code +(there are other cases in which you also need to access the +inputs and outputs, we will talk about them later). + +The only thing you must know about the \CPP code generated +from your \xml or your \CPP macro-based description +is that when you declare an input +or an output of a black box then +two \emph{accessors} for this input or output are generated : +one to \emph{get} the value of the input or output and +one to \emph{set} it. +These accessors have normalized names : + +\begin{itemize} +\item The declaration of an {\bf input} called \texttt{NAME} and +of type \texttt{TYPE} generates the two accessors +\footnote{For the sake of simplicity, the parameters and return value are +shown here as if they were all passed by value. +However the actual code can use references. +The same way, the issue of const or non const methods is eluded here. +Different cases occur in practice.}: +\begin{itemize} +\item \texttt{void bbSetInput();} +\item \texttt{ bbGetInput();} +\end{itemize} +\item The declaration of an {\bf output} called \texttt{NAME} and +of type \texttt{TYPE} generates the two accessors: +\begin{itemize} +\item \texttt{void bbSetOutput();} +\item \texttt{ bbGetOutput();} +\end{itemize} +\end{itemize} + +For example, declaring an input called \texttt{Image} +would generate the two accessors \texttt{bbSetInputImage} and +\texttt{bbGetInputImage}. + +Note that +\begin{itemize} +\item All \bbtk methods are prefixed by \texttt{bb} +to avoid conflicts with potential inherited methods. +\item An input and an output can have the same name (e.g. 'Image'). +No conflict between accessors occur (e.g. +four distinct accessors are created : +\texttt{bbSetInputImage}, +\texttt{bbGetInputImage}, +\texttt{bbSetOutputImage} and +\texttt{bbGetOutputImage}). +\end{itemize} + +% ========================================== +\subsection{\texttt{XML} description of a box} +% ========================================== + +% ========================================== +\subsubsection{General \texttt{xml} tags} +% ========================================== + +Let us examine the \texttt{xml} file +describing the \texttt{Add} box of the \texttt{std} package : + +\begin{file}{\texttt{src/packages/std/bbAdd.xml}} +\small +\begin{verbatim} + + + + + Adds its inputs + laurent.guigues@creatis.insa-lyon.fr + std + + bbtk::UserBlackBox + bbstd + + First number to add + Second number to add + Result + +
    +    bbSetOutputOut( bbGetInputIn1() + bbGetInputIn2() );
    +  
    + +
    +\end{verbatim} +\end{file} + +The tags and their role are easily understandable. + +As the box is not a widget, we inherit from +\texttt{bbtk::UserBlackBox} (\texttt{parentblackbox} tag). + +Note that we decided to include the generated class +into the namespace \texttt{bbstd}. + +The only part of the file which demand a bit of explaination is +the body of the \texttt{process} tag, which describes the +actual code to execute in the box. +This code must be enclosed in a \texttt{
    } tag 
    +to tell the \xml parser not to interpret it as \xml instructions. 
    +This is necessary to be able to use any symbol, 
    +like the \texttt{<} and \texttt{>} which have a 
    +special meaning in \xml. 
    +In the case of the \texttt{Add} box, the process code 
    +is very simple : remember that 
    +\texttt{bbGetInputIn1} is the 
    +accessor to the input \texttt{In1} declared above and 
    +\texttt{bbGetInputIn2} is the 
    +accessor to the input \texttt{In2};  
    +the code simply adds the values of the two inputs 
    +and sets the output \texttt{Out} with the resulting value.
    +
    +To describe your own black boxes in \xml code, 
    +you can use the template \texttt{xml} file 
    +\texttt{examples/TEMPLATE\_bbPackagenameBoxname.xml}.
    +
    +If \texttt{MyPack} is the name of your package and 
    +\texttt{MyBox} the name of your box, then :
    +\begin{enumerate}
    +\item Copy this file in your package folder with 
    +the normalised name \texttt{bbMyPackMyBox.xml} 
    +\item Replace each occurrence of \$PACKAGENAME\$ by MyPack 
    +and each occurrence of \$BOXNAME\$ by MyBox.
    +\item Fill in the description and author tags
    +\item Create your inputs and outputs
    +\item Fill in the process tag 
    +\end{enumerate} 
    +
    +
    +% ==========================================
    +\subsubsection{Specific \texttt{xml} tags for \texttt{itk::ImageToImageFilter} classes bbfication}
    +% ==========================================
    +
    +% ==========================================
    +\subsubsection{Specific \texttt{xml} tags for \texttt{vtkImageAlgorithm} classes bbfication}
    +% ==========================================
    +
    +% ==========================================
    +\subsubsection{Specific \texttt{xml} tags for \texttt{vtkPolyDataAlgorithm} classes bbfication}
    +% ==========================================
    +
    +% ==========================================
    +\subsubsection{\bbfy \texttt{xml} tags reference}
    +% ==========================================
    +
    +% ==========================================
    +\begin{table}[!ht]
    +\caption{\label{xml_tags}
    +\bbfy \texttt{xml} tags reference}
    +\small
    +\begin{tabular}{|lcllm{6cm}|}
    +\hline
    +Tag & Attributes & Condition & Multiplicity & Description
    + \\ \hline
    +
    +\texttt{} & \texttt{name} & - & 1 & The name of the box \\ \hline
    +		& \texttt{type} & - & 1 & The type of the box. In: 
    +	\{\texttt{standard} (default), 
    +\texttt{itkImageToImageFilter},
    +\texttt{vtkImageAlgorithm},
    +\texttt{vtkPolyDataAlgorithm}\} \\\hline
    +& \texttt{generic} & a) & 0-1 &
    +Generate the generic filter (see text)\\ \hline 
    +
    +\texttt{} & - & - & 0-n &  The description of the box. Multiple occurrence are concatenated \\\hline 
    +\texttt{} & - & - & 0-n &  The author of the box. Multiple occurrence are concatenated \\\hline 
    +\texttt{} & - & - & 1 &  The parent black box of the box.
    +In: \{\texttt{bbtk::BlackBox, bbtk::WxBlackBox, bbtk::WxContainerBlackBox}\}\\\hline 
    +\texttt{} & - & - & 1 &  The package of the box \\\hline 
    +\texttt{} & - & - & 0-1 &  The namespace of the box. 
    +Use \texttt{bbPACKAGE}, where \texttt{PACKAGE} is the name of the package\\\hline 
    +\texttt{} & - & - & 0-n & Additionnal file to include 
    +(generates : \texttt{\#include 'value'})\\\hline 
    +
    +\texttt{