Commit 887ec784 authored by Mickael Savinaud's avatar Mickael Savinaud

REFAC: remove the visualization framework from OTB

 All this stuff have been moved into Monteverdi
 To achieve this goal, I removed:
 - Utilities/FLTK
 - Code/Gui
 - Code/Visu (old visualization framework)
 - Code/Visualization
 - and their relative tests and examples
Some modifications have been also done into some CMakelists.txt to remove all links to visualization
parent 03bd67e1
This diff is collapsed.
message(STATUS "Importing FLTK...")
option(OTB_USE_VISU_GUI "Generate Gui/Visu tools directory. If ON, find OpenGL and FLTK packages." ON)
mark_as_advanced(OTB_USE_VISU_GUI)
set(OTB_GLU_INCLUDE_PATH "")
if(OTB_USE_VISU_GUI)
#-------------------------------
# OpenGL Library
#-------------------------------
find_package(OpenGL)
if( NOT OPENGL_FOUND )
message(FATAL_ERROR "Unable to find OpenGL on your system.\nCannot build OTB Visu module without OpenGL library.\nInstall OpenGL on your system OR set OTB_USE_VISU_GUI to OFF to disable OTB Visu module generation")
endif()
if( NOT OPENGL_GLU_FOUND )
message(FATAL_ERROR "Unable to find GLU library on your system.\nCannot build OTB Visu module without GLU library.\nInstall GLU library on your system OR set OTB_USE_VISU_GUI to OFF to disable OTB Visu module generation")
endif()
if(OPENGL_INCLUDE_DIR)
include_directories(${OPENGL_INCLUDE_DIR})
endif()
#-------------------------------
# Display images using textures using video card acceleration
#-------------------------------
# This option has generated numerous issues
# It usually does not work when doing remote display.
# Simply disable the possibility to activate it
#option(OTB_GL_USE_ACCEL "Use video card acceleration." OFF)
#mark_as_advanced(OTB_GL_USE_ACCEL)
#-------------------------------
# FLTK Library
#-------------------------------
# Use an external version of FLTK by default except on windows (FLTK is not packaged in OSGeo4W)
set(DEFAULT_OTB_USE_EXTERNAL_FLTK ON)
if(WIN32)
set(DEFAULT_OTB_USE_EXTERNAL_FLTK OFF)
endif()
option(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." ${DEFAULT_OTB_USE_EXTERNAL_FLTK})
mark_as_advanced(OTB_USE_EXTERNAL_FLTK)
if(OTB_USE_EXTERNAL_FLTK)
find_package(FLTK)
if(NOT FLTK_FOUND)
message(FATAL_ERROR
"Cannot build OTB project without FLTK. Please set FLTK_DIR or set OTB_USE_EXTERNAL_FLTK OFF to use INTERNAL FLTK.")
endif()
# Only if we used a FLTK 1.3.0 because in FLTK 1.1.>=9 is already done
if(FLTK_USE_FILE)
include_directories(${FLTK_INCLUDE_DIR})
# UseFLTK is buggy on windows, so we do not import it
# The definition of FLTK_EXE_LINKER_FLAGS in FLTKConfig.cmake
# is not valid and we end up with
# CMAKE_EXE_LINKER_FLAGS = " /STACK:10000000 /machine:X86 ; /STACK:10000000 /machine:X86"
# The ";" in the middle creates link error :
# impossible d'ouvrir le fichier en entrΘe ';.obj'
# include(${FLTK_USE_FILE})
endif()
else()
# Same Set as ITK
set(FLTK_SOURCE_DIR ${OTB_SOURCE_DIR}/Utilities/FLTK)
set(FLTK_BINARY_DIR ${OTB_BINARY_DIR}/Utilities/FLTK)
# Additionnal variables needed by OTB_VISU_GUI_LIBRARIES and FLTK_FLUID_EXECUTABLE
set(FLTK_LIBRARIES "fltk_images;fltk;fltk_gl;fltk_forms")
set(FLUID_COMMAND fluid)
# FLTK CMake needs a variable called JPEG_INCLUDE_DIR
set(JPEG_INCLUDE_DIR ${JPEG_INCLUDE_DIRS})
# Hints for libpng name, to find it automatically
set(PNG_NAMES libpng13 libpng14 libpng15 libpng16)
# Needed for version 1.1.>=9
set(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND})
endif()
set(OTB_VISU_GUI_LIBRARIES "${FLTK_LIBRARIES}")
if(APPLE)
set(OTB_VISU_GUI_LIBRARIES "${OTB_VISU_GUI_LIBRARIES};-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
endif()
if(OTB_USE_EXTERNAL_FLTK)
message(STATUS " Using FLTK external version ${FLTK_EXTERNAL_VERSION}")
message(STATUS " FLTK includes : ${FLTK_INCLUDE_DIR}")
message(STATUS " FLTK libraries: ${FLTK_LIBRARIES}")
message(STATUS " FLUID executable = ${FLTK_FLUID_EXECUTABLE}")
else()
message(STATUS " Using FLTK internal version")
endif()
else()
set(OTB_VISU_GUI_LIBRARIES "")
message(STATUS " Disabling FLTK support")
endif()
......@@ -57,9 +57,6 @@ set(OTB_CONFIG "@OTB_BINARY_DIR@")
# The OTB configuration options
set(OTB_SHOW_ALL_MSG_DEBUG "@OTB_SHOW_ALL_MSG_DEBUG@")
set(OTB_USE_EXTERNAL_ITK "@OTB_USE_EXTERNAL_ITK@")
set(OTB_USE_VISU_GUI "@OTB_USE_VISU_GUI@")
set(OTB_VISU_GUI_LIBRARIES "@OTB_VISU_GUI_LIBRARIES@")
set(OTB_USE_EXTERNAL_FLTK "@OTB_USE_EXTERNAL_FLTK@")
set(OTB_USE_CURL "@OTB_USE_CURL@")
set(OTB_CURL_MULTI_AVAILABLE "@OTB_CURL_MULTI_AVAILABLE@")
set(OTB_USE_EXTERNAL_BOOST "@OTB_USE_EXTERNAL_BOOST@")
......
......@@ -87,20 +87,6 @@ if(OTB_USE_EXTERNAL_GDAL)
include_directories(${GDAL_INCLUDE_DIRS})
endif()
if(OTB_USE_EXTERNAL_FLTK)
find_package(FLTK REQUIRED)
include_directories(${FLTK_INCLUDE_DIRS})
link_directories(${FLTK_LIBRARY_DIRS})
else()
find_program(FLTK_FLUID_EXECUTABLE fluid PATHS
${OTB_BINARY_DIRS}
${OTB_BINARY_DIRS}/Release
${OTB_BINARY_DIRS}/MinSizeRel
${OTB_BINARY_DIRS}/RelWithDebInfo
${OTB_BINARY_DIRS}/Debug
NO_SYSTEM_PATH)
endif()
if(OTB_USE_EXTERNAL_LIBKML)
find_package(LibKML REQUIRED)
include_directories(${LIBKML_INCLUDE_DIRS})
......
......@@ -73,9 +73,6 @@
#cmakedefine TIXML_USE_STL
#endif
/* Use Visu/Gui configurations */
#cmakedefine OTB_USE_VISU_GUI
#cmakedefine OTB_I18N
#define OTB_LANG @OTB_LANG@
#define OTB_LANG_LOCATION @OTB_LANG_LOCATION@
......
......@@ -132,16 +132,6 @@ else()
# so ITK_INCLUDE_DIRS is empty
endif()
if(OTB_USE_EXTERNAL_FLTK)
set(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${FLTK_INCLUDE_DIRS} )
else()
set(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${FLTK_SOURCE_DIR}
${FLTK_SOURCE_DIR}/src
${FLTK_BINARY_DIR} )
endif()
#-----------------------------------------------------------------------------
# Include directories needed for .cxx files in OTB. These include
# directories will NOT be available to user projects.
......@@ -149,22 +139,6 @@ set(OTB_INCLUDE_DIRS_BUILD_TREE_CXX)
set(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} )
#-----------------------------------------------------------------------------
# Include FLTK variables.
#if(NOT OTB_USE_EXTERNAL_FLTK)
# if(NOT EXISTS "${FLTK_BINARY_DIR}/FLTKConfig.cmake")
# message(FATAL_ERROR "Impossible to find the file ${FLTK_BINARY_DIR}/FLTKConfig.cmake. You must generate FLTK with cmake process.")
# else()
# include(${FLTK_BINARY_DIR}/FLTKConfig.cmake)
# endif()
#else()
# if(EXISTS "${OTB_BINARY_DIR}/Utilities/FLTK/FLTKConfig.cmake")
# include(${OTB_BINARY_DIR}/Utilities/FLTK/FLTKConfig.cmake)
# endif()
#endif()
#-----------------------------------------------------------------------------
# Include directories from libraries build tree.
......@@ -319,15 +293,6 @@ if(OTB_USE_SIFTFAST)
Utilities/otbsiftfast)
endif()
#For FLTK header file
if(OTB_USE_EXTERNAL_FLTK)
set(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
${FLTK_INCLUDE_DIRS})
else()
set(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
Utilities/FLTK)
endif()
#For TinyXML header file
if(OTB_USE_EXTERNAL_TINYXML)
set(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
......
......@@ -207,7 +207,6 @@ include(ImportGdal)
include(ImportExpat)
include(ImportITK)
include(ImportJPEG2000)
include(ImportFLTK) # depends on ImportGdal
include(ImportCurl)
include(ImportBoost)
include(ImportMapnik) # depends on ImportBoost
......@@ -379,7 +378,6 @@ if(NOT OTB_INSTALL_NO_DEVELOPMENT)
install(FILES
${OTB_SOURCE_DIR}/CMake/FindFFTW.cmake
${OTB_SOURCE_DIR}/CMake/FindEXPAT.cmake
${OTB_SOURCE_DIR}/CMake/FindFLTK.cmake
${OTB_SOURCE_DIR}/CMake/FindGettext.cmake
${OTB_SOURCE_DIR}/CMake/FindGettextLib.cmake
${OTB_SOURCE_DIR}/CMake/FindICUUC.cmake
......
......@@ -22,12 +22,6 @@ add_subdirectory(Simulation)
add_subdirectory(Hyperspectral)
add_subdirectory(Segmentation)
if(OTB_USE_VISU_GUI)
add_subdirectory(Visu)
add_subdirectory(Gui)
add_subdirectory(Visualization)
endif()
if(BUILD_APPLICATIONS)
add_subdirectory(ApplicationEngine)
add_subdirectory(Wrappers)
......
# Sources of non-templated classes.
file(GLOB OTBGui_SRCS "*.cxx" )
add_library(OTBGui ${OTBGui_SRCS})
target_link_libraries(OTBGui OTBCommon ${OTB_VISU_GUI_LIBRARIES})
if(OTB_LIBRARY_PROPERTIES)
set_target_properties(OTBGui PROPERTIES ${OTB_LIBRARY_PROPERTIES})
endif()
if(NOT OTB_INSTALL_NO_LIBRARIES)
install(TARGETS OTBGui
RUNTIME DESTINATION ${OTB_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${OTB_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${OTB_INSTALL_LIB_DIR} COMPONENT Development)
endif()
if(NOT OTB_INSTALL_NO_DEVELOPMENT)
file(GLOB __files1 "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
file(GLOB __files2 "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
install(FILES ${__files1} ${__files2}
DESTINATION ${OTB_INSTALL_INCLUDE_DIR}/Gui
COMPONENT Development)
endif()
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
Some parts of this code are derived from ITK. See ITKCopyright.txt
for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "otbFltkFilterWatcher.h"
namespace otb
{
FltkFilterWatcher
::FltkFilterWatcher(itk::ProcessObject* process,
int x, int y, int w, int h,
const char *comment)
: FilterWatcherBase(process, comment),
m_CurrentProgress(0)
{
m_Window = new Fl_Window(x, y, w + 10, h + 10);
m_Window->label(m_Comment.c_str());
m_Window->begin();
m_Progress = new Fl_Progress(5, 5, w, h);
m_Progress->selection_color(FL_DARK_BLUE);
m_Progress->minimum(0);
m_Progress->maximum(1);
m_Window->end();
}
FltkFilterWatcher
::~FltkFilterWatcher()
{
delete m_Progress;
delete m_Window;
}
void
FltkFilterWatcher
::StartFilter()
{
m_Window->show();
m_Progress->value(0);
m_Progress->show();
Fl::check();
}
void
FltkFilterWatcher
::ShowProgress()
{
if (m_Process)
{