diff --git a/Code/Core/otbWrapperApplicationRegistry.cxx b/Code/Core/otbWrapperApplicationRegistry.cxx index 6a9a6cc6335eb8108536c80964f5b7c8fdd3329d..ddbb9e2d75204a049fd47bfa4f4418ce9caa6a87 100644 --- a/Code/Core/otbWrapperApplicationRegistry.cxx +++ b/Code/Core/otbWrapperApplicationRegistry.cxx @@ -65,7 +65,7 @@ ApplicationRegistry::CreateApplication(const std::string& name) return appli; } -std::list<std::string> +std::vector<std::string> ApplicationRegistry::GetAvailableApplications() { ApplicationPointer appli; @@ -88,7 +88,7 @@ ApplicationRegistry::GetAvailableApplications() } // Return the app list - std::list<std::string> availableApp; + std::vector<std::string> availableApp; for(std::list<ApplicationPointer>::iterator k = possibleApp.begin(); k != possibleApp.end(); ++k) { diff --git a/Code/Core/otbWrapperApplicationRegistry.h b/Code/Core/otbWrapperApplicationRegistry.h index 6f3b17c7da1324fd7a58c930ee826dadc2601c88..38541784433b5c63d8ca777c319d07682b90c028 100644 --- a/Code/Core/otbWrapperApplicationRegistry.h +++ b/Code/Core/otbWrapperApplicationRegistry.h @@ -53,7 +53,7 @@ public: typedef otb::Wrapper::Application::Pointer ApplicationPointer; /** */ - static std::list<std::string> GetAvailableApplications(); + static std::vector<std::string> GetAvailableApplications(); /** Create the appropriate Application */ static Application::Pointer CreateApplication(const std::string& name); diff --git a/Code/Wrappers/ApplicationLauncherQt/otbApplicationLauncherQt.cxx b/Code/Wrappers/ApplicationLauncherQt/otbApplicationLauncherQt.cxx index 1c92036aa76eb9e307eb377824eee56cbdbee902..61e5f5bc62cbe84ee8eae75b46681a79106e7c41 100644 --- a/Code/Wrappers/ApplicationLauncherQt/otbApplicationLauncherQt.cxx +++ b/Code/Wrappers/ApplicationLauncherQt/otbApplicationLauncherQt.cxx @@ -72,10 +72,10 @@ int main(int argc, char* argv[]) const char* modulePath = itksys::SystemTools::GetEnv("ITK_AUTOLOAD_PATH"); std::cout << "Module search path : " << (modulePath ? modulePath : "") << std::endl; - std::list<std::string> list = ApplicationRegistry::GetAvailableApplications(); + std::vector<std::string> list = ApplicationRegistry::GetAvailableApplications(); std::cout << "Available applications : " << (list.empty() ? "None" : "") << std::endl; - for (std::list<std::string>::const_iterator it = list.begin(); it != list.end(); ++it) + for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it) { std::cout << " " << *it << std::endl; } diff --git a/Code/Wrappers/SWIG/CMakeLists.txt b/Code/Wrappers/SWIG/CMakeLists.txt index ad0f4339beeb7a6fa2b2c4ecc417e85f136a77ee..ee7f61c999b6ae509ef1beb6b2e749d0b28b7444 100644 --- a/Code/Wrappers/SWIG/CMakeLists.txt +++ b/Code/Wrappers/SWIG/CMakeLists.txt @@ -71,7 +71,7 @@ if ( WRAP_LUA OR WRAP_PYTHON OR WRAP_JAVA OR WRAP_CSHARP OR WRAP_TCL OR WRAP_R O ${CMAKE_CURRENT_SOURCE_DIR}/Java.i # ${CMAKE_CURRENT_SOURCE_DIR}/CSharp.i # ${CMAKE_CURRENT_SOURCE_DIR}/CSharpTypemapHelper.i -# ${CMAKE_CURRENT_SOURCE_DIR}/Lua.i + ${CMAKE_CURRENT_SOURCE_DIR}/Lua.i # ${CMAKE_CURRENT_SOURCE_DIR}/Tcl.i ) diff --git a/Code/Wrappers/SWIG/Java.i b/Code/Wrappers/SWIG/Java.i index aaef5aeea4a9ed0cee05eb7ee090491d174baf55..77bb080a03c1d05436c8ab3050e231583b9e45f3 100644 --- a/Code/Wrappers/SWIG/Java.i +++ b/Code/Wrappers/SWIG/Java.i @@ -93,7 +93,7 @@ } *(itkClass **)&$result = ptrRaw; } -*/ +*/ %typemap(out) itkClass##_Pointer { itkClass* ptrRaw = $1.GetPointer(); if (ptrRaw) { diff --git a/Code/Wrappers/SWIG/Python.i b/Code/Wrappers/SWIG/Python.i index 2896dc68d30b8351e79708a5486b3e124f052dc7..47c78d62422f574fd69b486b09bc13064606ab4b 100644 --- a/Code/Wrappers/SWIG/Python.i +++ b/Code/Wrappers/SWIG/Python.i @@ -119,12 +119,12 @@ %typemap(out) float &, const float &, double &, const double & {$result = PyFloat_FromDouble( *$1 );} -// transform std::list< std::string > to Python list of Python string -%typemap(out) std::list< std::string > +// transform std::vector< std::string > to Python list of Python string +%typemap(out) std::vector< std::string > { $result = PyList_New( $1.size() ); Py_ssize_t i = 0; - for (std::list< std::string >::const_iterator it = $1.begin(); + for (std::vector< std::string >::const_iterator it = $1.begin(); it != $1.end(); ++it, ++i ) { diff --git a/Code/Wrappers/SWIG/itkBase.i b/Code/Wrappers/SWIG/itkBase.i index bf1de473a8d98042b2a437c401b7aafc0b315743..fd0c7965a69df15de797548b94b0aca4e0711e67 100644 --- a/Code/Wrappers/SWIG/itkBase.i +++ b/Code/Wrappers/SWIG/itkBase.i @@ -56,11 +56,13 @@ //%include <std_iostream.i> //%include <std_sstream.i> %include <std_string.i> -//%include <std_vector.i> -//%include <std_list.i> +%include <std_vector.i> +//%include "std_list.i" -//%template(vectorstring) std::vector< std::string >; +%template(vectorstring) std::vector< std::string >; + +// list cannot be found for Java //%template(liststring) std::list< std::string >; //%template(vectorB) std::vector< bool >; diff --git a/Code/Wrappers/SWIG/otbApplication.i b/Code/Wrappers/SWIG/otbApplication.i index 51e0d27587b091b0a0369e0154cd1dceaf610436..fc128d832ca81c60f8ca0b26af0bd701800fa0ab 100644 --- a/Code/Wrappers/SWIG/otbApplication.i +++ b/Code/Wrappers/SWIG/otbApplication.i @@ -192,7 +192,7 @@ DECLARE_REF_COUNT_CLASS( Application ) class Registry : public itkObject { public: - static std::list<std::string> GetAvailableApplications(); + static std::vector<std::string> GetAvailableApplications(); static Application_Pointer CreateApplication(const std::string& name); protected: diff --git a/Testing/Core/otbWrapperApplicationRegistryTest.cxx b/Testing/Core/otbWrapperApplicationRegistryTest.cxx index 11564156bfec82a4612753aad2c75bfca44a7923..355a7c1c6ffb39a3fae701a2aa7b633e42b47c7b 100644 --- a/Testing/Core/otbWrapperApplicationRegistryTest.cxx +++ b/Testing/Core/otbWrapperApplicationRegistryTest.cxx @@ -24,10 +24,10 @@ int otbWrapperApplicationRegistry(int argc, char* argv[]) { using otb::Wrapper::ApplicationRegistry; - std::list<std::string> list = ApplicationRegistry::GetAvailableApplications(); + std::vector<std::string> list = ApplicationRegistry::GetAvailableApplications(); std::cout << "Available applications :" << std::endl; - std::list<std::string>::const_iterator it; + std::vector<std::string>::const_iterator it; for (it = list.begin(); it != list.end(); ++it) { std::cout << *it << std::endl; diff --git a/Testing/Java/CMakeLists.txt b/Testing/Java/CMakeLists.txt index 6756ef720264ee587493ea40bf6173bbfcc20042..e12721ad5fc2b6aae331d5be54f2e8e8928d7354 100644 --- a/Testing/Java/CMakeLists.txt +++ b/Testing/Java/CMakeLists.txt @@ -1,20 +1,16 @@ include( UseJava ) SET(TEST_DRIVER "${OTB_TEST_DRIVER}" - --add-before-env LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/Code/Wrappers/SWIG" --add-before-env ITK_AUTOLOAD_PATH "${CMAKE_BINARY_DIR}/Example" ) set( CMAKE_JAVA_INCLUDE_PATH ${OTB-Wrapper_BINARY_DIR}/Code/Wrappers/SWIG/org.otb.application.jar ) -add_jar( JavaSmoothingTest JavaSmoothingTest.java ) - - - -SET(JAVA_COMMAND "${JAVACOMMAND}" -Djava.library.path=${OTB-Wrapper_BINARY_DIR}/Code/Wrappers/SWIG) - +set( JAVA_COMMAND "${JAVACOMMAND}" -Djava.library.path=${OTB-Wrapper_BINARY_DIR}/Code/Wrappers/SWIG) +add_jar( JavaSmoothingTest JavaSmoothingTest.java ) +add_dependencies( JavaSmoothingTest otbApplicationJava ) add_test( NAME jaTvSmoothing COMMAND ${TEST_DRIVER} Execute ${JAVA_COMMAND} -cp ${CMAKE_JAVA_INCLUDE_PATH}:JavaSmoothingTest.jar SmoothingTest - ${OTB_DATA_ROOT}/Input/ToulouseExtract_WithGeom.tif - ${TEMP}/jaTvSmoothing_ ) + ${OTB_DATA_ROOT}/Input/ToulouseExtract_WithGeom.tif + ${TEMP}/jaTvSmoothing_ ) diff --git a/Testing/Java/JavaSmoothingTest.java b/Testing/Java/JavaSmoothingTest.java index 6c3c474b4b170aff4433a340555b7d145584008b..bab7cdce14ed5b8a6bb35788b81efc83dd2fca24 100644 --- a/Testing/Java/JavaSmoothingTest.java +++ b/Testing/Java/JavaSmoothingTest.java @@ -9,7 +9,13 @@ class SmoothingTest { public static void main( String argv[] ) { - System.out.println( "Available applications : " + Registry.GetAvailableApplications() ); + vectorstring appAvailable = Registry.GetAvailableApplications(); + System.out.println( "Available applications :" ); + + for (int i = 0; i < appAvailable.size(); i++) + { + System.out.println( appAvailable.get(i) ); + } Application_Pointer app = Registry.CreateApplication("Smoothing");