diff --git a/Code/IO/otbPrepareSRTMDirectory.txx b/Code/IO/otbPrepareSRTMDirectory.cxx similarity index 100% rename from Code/IO/otbPrepareSRTMDirectory.txx rename to Code/IO/otbPrepareSRTMDirectory.cxx diff --git a/Code/Projections/otbPrepareSRTMDirectory.txx b/Code/Projections/otbPrepareSRTMDirectory.txx deleted file mode 100644 index 19bb4d4dcfeead349bb3ba72cc4b1b8cb57cc6d8..0000000000000000000000000000000000000000 --- a/Code/Projections/otbPrepareSRTMDirectory.txx +++ /dev/null @@ -1,132 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.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. - -=========================================================================*/ -#ifndef __otbPrepareSRTMDirectory_txx -#define __otbPrepareSRTMDirectory_txx - -#include "otbPrepareSRTMDirectory.h" - - -namespace otb -{ - -/** - * Constructor - */ - -PrepareSRTMDirectory::PrepareSRTMDirectory() -{ - m_ULLon = 0.0; - m_ULLat = 0.0; - m_LRLon = 0.0; - m_LRLat = 0.0; - m_FullDEMDirectoryPath = ""; - m_DEMDirectoryPath = ""; -} - -/** - * - */ - -void -PrepareSRTMDirectory -::PrintSelf(std::ostream& os, itk::Indent indent) const -{ - this->Superclass::PrintSelf(os,indent); - os << indent << " m_ULLon " << m_ULLon << std::endl; - os << indent << " m_ULLat " << m_ULLat << std::endl; - os << indent << " m_LRLon " << m_LRLon << std::endl; - os << indent << " m_LRLat " << m_LRLat << std::endl; - os << indent << " m_FullDEMDirectoryPath" << m_FullDEMDirectoryPath << std::endl; - os << indent << " m_DEMDirectoryPath" << m_DEMDirectoryPath << std::endl; -} - - -bool PrepareSRTMDirectory::Evaluate() -{ - - int startX = static_cast<int>(floor(m_ULLon)); - int endX = static_cast<int>(ceil(m_LRLon)); - int startY = static_cast<int>(floor(m_LRLat)); - int endY = static_cast<int>(ceil(m_ULLat)); - - std::cout << startX << std::endl; - std::cout << endX << std::endl; - std::cout << startY << std::endl; - std::cout << endY << std::endl; - - for (int j=startY; j<endY; j++) - { - for (int i=startX; i< endX; i++) - { - std::ostringstream inputfilename; - inputfilename << m_FullDEMDirectoryPath; - inputfilename << "/"; - - std::ostringstream outputfilename; - outputfilename << m_DEMDirectoryPath; - outputfilename << "/"; - - if (j >= 0) - { - inputfilename << "N"; - inputfilename << setfill('0') << setw(2) << j; - outputfilename << "N"; - outputfilename << setfill('0') << setw(2) << j; - } - else - { - inputfilename << "S"; - inputfilename << setfill('0') << setw(2) << -j; - outputfilename << "S"; - outputfilename << setfill('0') << setw(2) << -j; - } - if (i >= 0) - { - inputfilename << "E"; - inputfilename << setfill('0') << setw(3) << i; - outputfilename << "E"; - outputfilename << setfill('0') << setw(3) << i; - } - else - { - inputfilename << "W"; - inputfilename << setfill('0') << setw(3) << -i; - outputfilename << "W"; - outputfilename << setfill('0') << setw(3) << -i; - } - - inputfilename << ".hgt"; - outputfilename << ".hgt"; - - std::cout << "Copying " << inputfilename.str() << " to " << outputfilename.str() << std::endl; - - //copy input file to output file - ossimFilename inputFile(inputfilename.str().c_str()); - ossimFilename outputFile(outputfilename.str().c_str()); - inputFile.copyFileTo(outputFile); - - - } - } - - return true; -} - -} // namespace otb - -#endif diff --git a/Testing/Code/DisparityMap/otbMIRegistrationFilter.cxx b/Testing/Code/DisparityMap/otbMIRegistrationFilter.cxx index ddf5bc7652316f403426b980e08b495a1d24d98c..6d246710145b74c76f0ce9862b05ff8cf89fb72c 100644 --- a/Testing/Code/DisparityMap/otbMIRegistrationFilter.cxx +++ b/Testing/Code/DisparityMap/otbMIRegistrationFilter.cxx @@ -93,9 +93,11 @@ int otbMIRegistrationFilter(int argc, char* argv []) DFWriterType::Pointer dfWriter = DFWriterType::New(); dfWriter->SetFileName(argv[3]); dfWriter->SetInput( registrator->GetOutput() ); + + std::cout<<"UPDATE"<<std::endl; dfWriter->Update(); + std::cout<<"UPDATE"<<std::endl; return EXIT_SUCCESS; - } diff --git a/Testing/Code/IO/CMakeLists.txt b/Testing/Code/IO/CMakeLists.txt index c9cf9158f2a1a67d087a9b85d7c0ded674e4166b..76c08420f4cf56136edce0028c91b35b21cd6f8f 100755 --- a/Testing/Code/IO/CMakeLists.txt +++ b/Testing/Code/IO/CMakeLists.txt @@ -1758,7 +1758,12 @@ ADD_TEST(ioTvDEMToOrthoImageGeneratorTest ${IO_TESTS17} N # hemisphere ) +# --- otb::PrepareSRTMDirectory --- +ADD_TEST(ioTuPrepareSRTMDirectoryNew ${IO_TESTS17} + otbPrepareSRTMDirectoryNew ) +#ADD_TEST(ioTuPrepareSRTMDirectoryTest ${IO_TESTS17} +# otbPrepareSRTMDirectoryTest ) #---------------------------------------------------------------------------------- SET(BasicIO_SRCS1 @@ -1901,6 +1906,8 @@ otbPointSetFileReader.cxx otbImageIOFactoryNew.cxx otbDEMToOrthoImageGeneratorNew.cxx otbDEMToOrthoImageGeneratorTest.cxx +otbPrepareSRTMDirectoryNew.cxx +#otbPrepareSRTMDirectoryTest.cxx ) INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}") diff --git a/Testing/Code/IO/otbIOTests17.cxx b/Testing/Code/IO/otbIOTests17.cxx index 00ce05ce088d78f3c5d23f8d66c5b3d7c6fc0aaf..a29c5c86ce837b874768ecc92b58145dc86f7b7d 100644 --- a/Testing/Code/IO/otbIOTests17.cxx +++ b/Testing/Code/IO/otbIOTests17.cxx @@ -33,4 +33,6 @@ REGISTER_TEST(otbPointSetFileReader); REGISTER_TEST(otbImageIOFactoryNew); REGISTER_TEST(otbDEMToOrthoImageGeneratorNew); REGISTER_TEST(otbDEMToOrthoImageGeneratorTest); +REGISTER_TEST(otbPrepareSRTMDirectoryNew); +//REGISTER_TEST(otbPrepareSRTMDirectoryTest); } diff --git a/Testing/Code/Projections/otbPrepareSRTMDirectoryNew.cxx b/Testing/Code/IO/otbPrepareSRTMDirectoryNew.cxx similarity index 100% rename from Testing/Code/Projections/otbPrepareSRTMDirectoryNew.cxx rename to Testing/Code/IO/otbPrepareSRTMDirectoryNew.cxx diff --git a/Testing/Code/Projections/CMakeLists.txt b/Testing/Code/Projections/CMakeLists.txt index 71c7d98f9f0cfab155ce4fd649fec971f20d13dd..4248f8161feb7d6329a3a1f6f6196ffdb51b3e60 100644 --- a/Testing/Code/Projections/CMakeLists.txt +++ b/Testing/Code/Projections/CMakeLists.txt @@ -17,7 +17,6 @@ SET(EPSILON 0.0001) SET(PROJECTIONS_TESTS1 ${CXX_TEST_PATH}/otbProjectionsTests1) SET(PROJECTIONS_TESTS2 ${CXX_TEST_PATH}/otbProjectionsTests2) SET(PROJECTIONS_TESTS3 ${CXX_TEST_PATH}/otbProjectionsTests3) -SET(PROJECTIONS_TESTS4 ${CXX_TEST_PATH}/otbProjectionsTests4) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbPROJECTIONS_TESTS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -336,24 +335,6 @@ ADD_TEST(prTvGeocentricTransform ${PROJECTIONS_TESTS3} ${TEMP}/prTvGeocentricTransform.txt ) - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbPROJECTIONS_TESTS4 ~~~~~~~~~~~~~~~~~~~~~~~~~~ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -ADD_TEST(prTuPrepareSRTMDirectoryNew ${PROJECTIONS_TESTS4} - otbPrepareSRTMDirectoryNew ) - - - - - - - - - - - #======================================================================================= SET(Projections_SRCS1 otbProjectionBaseNew.cxx @@ -384,9 +365,7 @@ otbVectorDataProjectionFilterFromMapToGeo.cxx otbGeocentricTransformNew.cxx otbGeocentricTransform.cxx ) -SET(Projections_SRCS4 -otbPrepareSRTMDirectoryNew.cxx -) + INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}") @@ -396,7 +375,5 @@ ADD_EXECUTABLE(otbProjectionsTests2 otbProjectionsTests2.cxx ${Projections_SRCS2 TARGET_LINK_LIBRARIES(otbProjectionsTests2 OTBProjections OTBIO) ADD_EXECUTABLE(otbProjectionsTests3 otbProjectionsTests3.cxx ${Projections_SRCS3}) TARGET_LINK_LIBRARIES(otbProjectionsTests3 OTBProjections OTBIO) -ADD_EXECUTABLE(otbProjectionsTests4 otbProjectionsTests4.cxx ${Projections_SRCS4}) -TARGET_LINK_LIBRARIES(otbProjectionsTests4 OTBProjections OTBIO) ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )