diff --git a/Code/DisparityMap/otbNCCRegistrationFilter.txx b/Code/DisparityMap/otbNCCRegistrationFilter.txx index af6bb1756630b562b032cf406a2e7340af4cd3d3..e692568ddce2221c4da3f880b3ac5cb477814c95 100644 --- a/Code/DisparityMap/otbNCCRegistrationFilter.txx +++ b/Code/DisparityMap/otbNCCRegistrationFilter.txx @@ -155,6 +155,7 @@ NCCRegistrationFilter<TFixedImage,TMovingImage,TDeformationField> drfp->SetRadius(radius); + this->Modified(); } template <class TFixedImage, class TMovingImage, class TDeformationField> diff --git a/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx b/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx index 9066bb43ae54a8a62a46ad5229f4cc81cbee1dea..d3fda1604cd7664dcdf114975b6c369dc9e3290a 100644 --- a/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx +++ b/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx @@ -138,8 +138,8 @@ namespace otb /** For each octave, we fill the imageList for the extremum search*/ m_ImageList->PushBack(m_determinantImage); - } - + } + /*----------------------------------------------------*/ /* extremum Search over octave's scales */ /*----------------------------------------------------*/ @@ -351,7 +351,7 @@ namespace otb { col = i%Largeur - rayon ; raw = i/Largeur - rayon ; - dist = vcl_sqrt(col *col + raw * raw ); + dist = vcl_sqrt(static_cast<double>(col *col + raw * raw) ); col +=rayon; raw +=rayon; // Backup to the image coordinate axes diff --git a/Code/Visu/otbFixedSizeFullImageWidget.txx b/Code/Visu/otbFixedSizeFullImageWidget.txx index 11214a88cefd22e2f3b60a4f96952a341cea34dd..dc3a4dd7996fa451bda2d0282936258d1b45db72 100644 --- a/Code/Visu/otbFixedSizeFullImageWidget.txx +++ b/Code/Visu/otbFixedSizeFullImageWidget.txx @@ -121,7 +121,7 @@ FixedSizeFullImageWidget<TPixel> ::UpdateOpenGlBufferedRegion(void) { //otbMsgDebugMacro(<<"UpdateOpenGlBufferedRegion: "<<this->GetViewedRegion()); - this->SetBufferedRegion((this->GetInput()->GetLargestPossibleRegion())); + this->SetBufferedRegion(this->GetViewedRegion()); } } // end namespace otb #endif diff --git a/Code/Visu/otbImageWidgetBase.txx b/Code/Visu/otbImageWidgetBase.txx index 659edaa32b6b99354f09a939ae3bdc39f661c4bb..4b45dd2d7f73c6aa15e80002e4209fa3fe0c0e6c 100644 --- a/Code/Visu/otbImageWidgetBase.txx +++ b/Code/Visu/otbImageWidgetBase.txx @@ -179,14 +179,12 @@ ImageWidgetBase<TPixel> { m_Image=image; m_Image->UpdateOutputInformation(); - SizeType size; size.Fill(0); m_BufferedRegion.SetSize(size); SizeType displaySize; displaySize[0]=this->w(); displaySize[1]=this->h(); - m_ViewedRegion.SetSize(displaySize); m_ViewedRegion.Crop(m_Image->GetLargestPossibleRegion()); } @@ -300,10 +298,14 @@ ImageWidgetBase<TPixel> m_ImageOverlay->SetRequestedRegion(m_BufferedRegion); m_ImageOverlay->PropagateRequestedRegion(); m_ImageOverlay->UpdateOutputData(); - RebuildOpenGlImageOverlayBuffer(); } } + if(m_ImageOverlayVisible) + { + RebuildOpenGlImageOverlayBuffer(); + } + if (!this->valid()) { valid(1); @@ -322,10 +324,15 @@ ImageWidgetBase<TPixel> glDisable(GL_BLEND); - glRasterPos2i(0,0); - #ifndef OTB_GL_USE_ACCEL - glPixelZoom(m_OpenGlIsotropicZoom, m_OpenGlIsotropicZoom); + + // To be consistent with old method + int displayHeight = static_cast<int>(vcl_ceil(m_BufferedRegion.GetSize()[1]*m_OpenGlIsotropicZoom)); + int viewPortOffset = 0; + viewPortOffset = h()-displayHeight; + glRasterPos2i(0,viewPortOffset); + + glPixelZoom(m_OpenGlIsotropicZoom,m_OpenGlIsotropicZoom); // display the image glDrawPixels(m_BufferedRegion.GetSize()[0], @@ -426,6 +433,7 @@ ImageWidgetBase<TPixel> //otbMsgDebugMacro(<<"Deleting previous buffer ..."); delete [] m_OpenGlBuffer; } + //otbMsgDebugMacro(<<"Buffered region: "<<m_BufferedRegion); unsigned int bufferLenght = 4*m_BufferedRegion.GetNumberOfPixels(); //otbMsgDebugMacro(<<"New buffer lenght: "<<bufferLenght); m_OpenGlBuffer = new unsigned char[bufferLenght]; diff --git a/Examples/IO/CMakeLists.txt b/Examples/IO/CMakeLists.txt index 378ebee0633b1b3c76b71adfcf66ca4db376d108..3667f0d38e881a3aaacf450a013a878a669bcd82 100644 --- a/Examples/IO/CMakeLists.txt +++ b/Examples/IO/CMakeLists.txt @@ -169,4 +169,9 @@ ENDIF(ITK_USE_REVIEW) ADD_EXECUTABLE(otbIOExamplesTests otbIOExamplesTests.cxx) TARGET_LINK_LIBRARIES(otbIOExamplesTests otbossim OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale OTBProjections ITKIO ITKAlgorithms ITKStatistics ITKCommon ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES}) +IF(ITK_USE_REVIEW) +ADD_EXECUTABLE(otbIOExamplesTests2 otbIOExamplesTests2.cxx) +TARGET_LINK_LIBRARIES(otbIOExamplesTests2 otbossim OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale OTBProjections ITKIO ITKAlgorithms ITKStatistics ITKCommon ${OTB_IO_UTILITIES_DEPENDENT_LIBRARIES}) +ENDIF(ITK_USE_REVIEW) + ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING ) diff --git a/Examples/IO/otbIOExamplesTests.cxx b/Examples/IO/otbIOExamplesTests.cxx index 5a2ded9aad01c872df37c871f06f34a99fbe5d43..3873c5047e5b7bc8836bd68db1c6016de06304bf 100644 --- a/Examples/IO/otbIOExamplesTests.cxx +++ b/Examples/IO/otbIOExamplesTests.cxx @@ -27,7 +27,6 @@ void RegisterTests() { REGISTER_TEST(ExtractROITest); REGISTER_TEST(DEMToImageGeneratorTest); -REGISTER_TEST(LidarToImageExampleTest); } #undef main @@ -37,7 +36,3 @@ REGISTER_TEST(LidarToImageExampleTest); #undef main #define main DEMToImageGeneratorTest #include "DEMToImageGenerator.cxx" - -#undef main -#define main LidarToImageExampleTest -#include "LidarToImageExample.cxx" diff --git a/Examples/IO/otbIOExamplesTests2.cxx b/Examples/IO/otbIOExamplesTests2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d168b7eda4334dcb98d265c2156700d84c501125 --- /dev/null +++ b/Examples/IO/otbIOExamplesTests2.cxx @@ -0,0 +1,33 @@ +/*========================================================================= + + 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. + +=========================================================================*/ + +// this file defines the otbMultiScaleTest for the test driver +// and all it expects is that you have a function called RegisterTests +#if defined(_MSC_VER) +#pragma warning ( disable : 4786 ) +#endif +#include <iostream> +#include "otbTestMain.h" + +void RegisterTests() +{ +REGISTER_TEST(LidarToImageExampleTest); +} + +#undef main +#define main LidarToImageExampleTest +#include "LidarToImageExample.cxx"