diff --git a/Code/BasicFilters/otbSimplifyPathFunctor.h b/Code/BasicFilters/otbSimplifyPathFunctor.h index 91c868b1a7763f08aa7e44372dec64545d0f286e..f9fd52e8295a34719383a02e163d78e9f8cdf3a9 100644 --- a/Code/BasicFilters/otbSimplifyPathFunctor.h +++ b/Code/BasicFilters/otbSimplifyPathFunctor.h @@ -50,10 +50,10 @@ class SimplifyPathFunctor { public: - typedef typename TInput::ObjectType::VertexListType::ConstIterator VertexListConstIteratorType; - typedef typename TInput::ObjectType::VertexListType::ConstPointer VertexListConstPointerType; - typedef TOutput OutputPathPointerType; - typedef typename OutputPathPointerType::ObjectType OutputPathType; + typedef typename TInput::VertexListType::ConstIterator VertexListConstIteratorType; + typedef typename TInput::VertexListType::ConstPointer VertexListConstPointerType; + typedef TOutput OutputPathType; + typedef typename OutputPathType::Pointer OutputPathPointerType; void SetTolerance(double Tolerance ) { @@ -70,7 +70,7 @@ public: }; ~SimplifyPathFunctor() {}; - inline OutputPathPointerType operator()(const TInput & input) + inline OutputPathPointerType operator()(const TInput * input) { OutputPathPointerType newPath = OutputPathType::New(); diff --git a/Code/FeatureExtraction/otbSimplifyPathListFilter.h b/Code/FeatureExtraction/otbSimplifyPathListFilter.h index 5da8fb3f9d5fe98ade37bc34bcdb2b0a3aaa3c75..77400608c19a96e7acc640fc4d73191d9106492c 100644 --- a/Code/FeatureExtraction/otbSimplifyPathListFilter.h +++ b/Code/FeatureExtraction/otbSimplifyPathListFilter.h @@ -64,7 +64,7 @@ class ITK_EXPORT SimplifyPathListFilter: public UnaryFunctorObjectListFilter< ObjectList<TPath>, ObjectList<TPath>, - SimplifyPathFunctor<typename TPath::Pointer, typename TPath::Pointer> > + SimplifyPathFunctor<TPath,TPath> > {}; }// End namespace otb diff --git a/Code/Learning/otbSOMWithMissingValue.txx b/Code/Learning/otbSOMWithMissingValue.txx index 57d8cd449d30e38b5e1db87e91426ab4440347bd..080c0080d875bc19bab231f836e2615a84a36823 100644 --- a/Code/Learning/otbSOMWithMissingValue.txx +++ b/Code/Learning/otbSOMWithMissingValue.txx @@ -9,11 +9,11 @@ Version: $Revision$ Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. See OTBCopyright.txt for details. -Copyright (c) Institut Telecom ; Telecom bretagne. All rights reserved. +Copyright (c) Institut Telecom ; Telecom bretagne. All rights reserved. See ITCopyright.txt for details. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +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. =========================================================================*/ @@ -33,21 +33,19 @@ PURPOSE. See the above copyright notices for more information. namespace otb { /** - * Update the output map with a new sample by including the case when some + * Update the output map with a new sample by including the case when some * components of this new sample may be missing. * \param sample The new sample to learn, * \param beta The learning coefficient, * \param radius The radius of the nieghbourhood. */ template < class TListSample, class TMap, - class TSOMLearningBehaviorFunctor, + class TSOMLearningBehaviorFunctor, class TSOMNeighborhoodBehaviorFunctor > void SOMWithMissingValue< TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighborhoodBehaviorFunctor > ::UpdateMap( const NeuronType& sample, double beta, SizeType& radius ) { - int i,j; - // output map pointer MapPointerType map = this->GetOutput(0); @@ -61,7 +59,7 @@ SOMWithMissingValue< TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighbo typename MapType::RegionType mapRegion = map->GetLargestPossibleRegion(); NeighborhoodIteratorType it ( radius, map, mapRegion ); - // Here, the periodic update is achieved 'by hand' since + // Here, the periodic update is achieved 'by hand' since // PeriodicBoundaryCondition does not allow to modifiy // VectorImage contents SizeType mapSize = mapRegion.GetSize(); @@ -70,22 +68,22 @@ SOMWithMissingValue< TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighbo // Iterate over the neighborhood ot the winner neuron it.SetLocation( position ); - for ( i = 0; i < it.Size(); i++ ) + for (unsigned int i = 0; i < it.Size(); i++ ) { typename NeighborhoodIteratorType::OffsetType offset = it.GetOffset(i); - + // The neighborhood is of elliptic shape double theDistance = itk::NumericTraits< double >::Zero; - for ( j = 0; j < MapType::ImageDimension; j++ ) + for (int j = 0; j < MapType::ImageDimension; j++ ) theDistance += pow( static_cast<double>( offset[j] ), 2.0 ) / pow( static_cast<double>( radius[j] ), 2.0 ); if ( theDistance <= 1.0 ) { - for ( j = 0; j < MapType::ImageDimension; j++ ) + for (int j = 0; j < MapType::ImageDimension; j++ ) { int pos = offset[j] + position[j]; - positionToUpdate[j] = ( pos >= 0 ) ? + positionToUpdate[j] = ( pos >= 0 ) ? pos % mapSize[j] : ( mapSize[j] - ( (-pos) % mapSize[j] ) ) % mapSize[j]; } @@ -94,7 +92,7 @@ SOMWithMissingValue< TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighbo NeuronType newNeuron ( tempNeuron ); double tempBeta = beta / ( 1.0 + theDistance ); - for( j = 0; j < newNeuron.Size(); j++ ) + for(unsigned int j = 0; j < newNeuron.Size(); j++ ) { if ( !DistanceType::IsMissingValue( sample[j] ) ) newNeuron[j] += static_cast<typename NeuronType::ValueType>( diff --git a/Code/Visualization/otbImageLayer.h b/Code/Visualization/otbImageLayer.h index f7f5a0afaad77d567ecd734c003f604b6a5eb158..2448e08e98c8fbdd21e9d764a58d0c10ba7e8efa 100644 --- a/Code/Visualization/otbImageLayer.h +++ b/Code/Visualization/otbImageLayer.h @@ -179,6 +179,22 @@ public: /** Get the pixel location */ virtual PointType GetPixelLocation(const IndexType & index); + /** Get the list sample used by the rendering function */ + virtual ListSamplePointerType GetListSample() + { +// this->UpdateListSample();//FIXME condition to IsModified + return m_ListSample; + } + + /** Set the list sample used by the rendering function */ + virtual void SetListSample(ListSamplePointerType listSample) + { + m_ListSample = listSample; + m_ListSampleProvided = true; + m_RenderingFunction->SetListSample(m_ListSample); + } + + protected: /** Constructor */ ImageLayer(); @@ -190,12 +206,6 @@ protected: /** Update the histogram */ virtual void UpdateListSample(); - virtual ListSamplePointerType GetListSample() - { -// this->UpdateListSample();//FIXME condition to IsModified - return m_ListSample; - } - /** Update the images */ virtual void RenderImages(); @@ -219,6 +229,7 @@ private: /** List sample used to compute the histogram by the rendering function*/ ListSamplePointerType m_ListSample; + bool m_ListSampleProvided;//To remember if the list sample was provided manually by the user /** Rendering function */ RenderingFunctionPointerType m_RenderingFunction; diff --git a/Code/Visualization/otbImageLayer.txx b/Code/Visualization/otbImageLayer.txx index 2f3e5f1c068346ccfd19b67e0f1d81c8cb359d04..6e55f08a53fdc49f41d57884a071a58a3227f7e1 100644 --- a/Code/Visualization/otbImageLayer.txx +++ b/Code/Visualization/otbImageLayer.txx @@ -31,7 +31,7 @@ namespace otb template <class TImage, class TOutputImage> ImageLayer<TImage,TOutputImage> -::ImageLayer() : m_Quicklook(), m_Image(), m_ListSample(), m_RenderingFunction(), +::ImageLayer() : m_Quicklook(), m_Image(), m_ListSample(), m_ListSampleProvided(false), m_RenderingFunction(), m_QuicklookRenderingFilter(), m_ExtractRenderingFilter(), m_ScaledExtractRenderingFilter(), m_ExtractFilter(), m_ScaledExtractFilter() { @@ -153,57 +153,60 @@ void ImageLayer<TImage,TOutputImage> ::UpdateListSample() { -// otbMsgDevMacro(<<"ImageLayer::UpdateListSample():"<<" ("<<this->GetName()<<")"<< " Entering method"); - // Declare the source of the histogram - ImagePointerType histogramSource; + if(!m_ListSampleProvided) + { + // otbMsgDevMacro(<<"ImageLayer::UpdateListSample():"<<" ("<<this->GetName()<<")"<< " Entering method"); + // Declare the source of the histogram + ImagePointerType histogramSource; - // if there is a quicklook, use it for histogram generation - if(m_Quicklook.IsNotNull()) - { - histogramSource = m_Quicklook; - } - else - { - // Else use the full image (update the data) - // REVIEW: Not sure the region is right here. Should be the - // largest ? - // REPLY: might be... didn't change anything - // - histogramSource = m_Image; - histogramSource->SetRequestedRegion(this->GetExtractRegion()); - } + // if there is a quicklook, use it for histogram generation + if(m_Quicklook.IsNotNull()) + { + histogramSource = m_Quicklook; + } + else + { + // Else use the full image (update the data) + // REVIEW: Not sure the region is right here. Should be the + // largest ? + // REPLY: might be... didn't change anything + // + histogramSource = m_Image; + histogramSource->SetRequestedRegion(this->GetExtractRegion()); + } - // Check if we need to generate the histogram again - if( m_ListSample.IsNull() || m_ListSample->Size() == 0 || (histogramSource->GetUpdateMTime() < histogramSource->GetPipelineMTime()) ) - { - otbMsgDevMacro(<<"ImageLayer::UpdateListSample():"<<" ("<<this->GetName()<<")"<< " Regenerating histogram due to pippeline update."); + // Check if we need to generate the histogram again + if( m_ListSample.IsNull() || m_ListSample->Size() == 0 || (histogramSource->GetUpdateMTime() < histogramSource->GetPipelineMTime()) ) + { + otbMsgDevMacro(<<"ImageLayer::UpdateListSample():"<<" ("<<this->GetName()<<")"<< " Regenerating histogram due to pippeline update."); - // Update the histogram source - histogramSource->Update(); + // Update the histogram source + histogramSource->Update(); - // Iterate on the image - itk::ImageRegionConstIterator<ImageType> it(histogramSource,histogramSource->GetBufferedRegion()); + // Iterate on the image + itk::ImageRegionConstIterator<ImageType> it(histogramSource,histogramSource->GetBufferedRegion()); - // declare a list to store the samples - m_ListSample->Clear(); + // declare a list to store the samples + m_ListSample->Clear(); - unsigned int sampleSize = VisualizationPixelTraits::PixelSize(it.Get()); - m_ListSample->SetMeasurementVectorSize(sampleSize); + unsigned int sampleSize = VisualizationPixelTraits::PixelSize(it.Get()); + m_ListSample->SetMeasurementVectorSize(sampleSize); - // Fill the samples list - it.GoToBegin(); - while(!it.IsAtEnd()) - { - SampleType sample(sampleSize); - VisualizationPixelTraits::Convert( it.Get(), sample ); - m_ListSample->PushBack(sample); - ++it; - } - otbMsgDevMacro(<<"ImageLayer::UpdateListSample()"<<" ("<<this->GetName()<<")"<< " Sample list generated ("<<m_ListSample->Size()<<" samples, "<< sampleSize <<" bands)"); + // Fill the samples list + it.GoToBegin(); + while(!it.IsAtEnd()) + { + SampleType sample(sampleSize); + VisualizationPixelTraits::Convert( it.Get(), sample ); + m_ListSample->PushBack(sample); + ++it; + } + otbMsgDevMacro(<<"ImageLayer::UpdateListSample()"<<" ("<<this->GetName()<<")"<< " Sample list generated ("<<m_ListSample->Size()<<" samples, "<< sampleSize <<" bands)"); - m_RenderingFunction->SetListSample(m_ListSample); + m_RenderingFunction->SetListSample(m_ListSample); - } + } + } } diff --git a/Code/Visualization/otbImageLayerRenderingModel.h b/Code/Visualization/otbImageLayerRenderingModel.h index 7a7654acb877979a14ee86ee7b4c50a58635fdf4..cb040493996a70c9d99ff372f4df0010f071d3c1 100644 --- a/Code/Visualization/otbImageLayerRenderingModel.h +++ b/Code/Visualization/otbImageLayerRenderingModel.h @@ -40,14 +40,15 @@ namespace otb * \ingroup Visualization */ -template <class TOutputImage = otb::Image<itk::RGBAPixel<unsigned char>,2 > > +template <class TOutputImage = otb::Image<itk::RGBAPixel<unsigned char>,2 >, + class TLayer = otb::ImageLayerBase<TOutputImage> > class ImageLayerRenderingModel - : public MVCModelBase<ImageLayerRenderingModelListener>, public LayerBasedModel< ImageLayerBase<TOutputImage> > + : public MVCModelBase<ImageLayerRenderingModelListener>, public LayerBasedModel< TLayer > { public: /** Standard class typedefs */ typedef ImageLayerRenderingModel Self; - typedef LayerBasedModel< ImageLayerBase <TOutputImage> > Superclass; + typedef LayerBasedModel<TLayer> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Visualization/otbImageLayerRenderingModel.txx b/Code/Visualization/otbImageLayerRenderingModel.txx index ceeca9568648ee5212d7c5b92719b70b595d2a93..f00ff1103f5553e662162604bdfd3397d00c37b6 100644 --- a/Code/Visualization/otbImageLayerRenderingModel.txx +++ b/Code/Visualization/otbImageLayerRenderingModel.txx @@ -25,8 +25,8 @@ namespace otb { -template <class TOutputImage> -ImageLayerRenderingModel<TOutputImage> +template <class TOutputImage, class TLayer> +ImageLayerRenderingModel<TOutputImage, TLayer> ::ImageLayerRenderingModel() : m_Name("Default"), m_RasterizedQuicklook(), m_HasQuicklook(false),m_RasterizedExtract(),m_HasExtract(false), m_ExtractRegion(), m_RasterizedScaledExtract(), m_HasScaledExtract(false), @@ -40,14 +40,14 @@ ImageLayerRenderingModel<TOutputImage> m_ScaledExtractBlendingFilterList = BlendingFilterListType::New(); } -template <class TOutputImage> -ImageLayerRenderingModel<TOutputImage> +template <class TOutputImage, class TLayer> +ImageLayerRenderingModel<TOutputImage, TLayer> ::~ImageLayerRenderingModel() {} -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::Update() { // Multiple concurrent update guards @@ -65,9 +65,9 @@ ImageLayerRenderingModel<TOutputImage> } -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::Init() { m_QuicklookBlendingFilterList = BlendingFilterListType::New(); @@ -80,9 +80,9 @@ ImageLayerRenderingModel<TOutputImage> -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::RenderVisibleLayers() { // Render all visible layers @@ -105,9 +105,9 @@ ImageLayerRenderingModel<TOutputImage> } } -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::RasterizeVisibleLayers() { // If there are no layer to render @@ -240,9 +240,9 @@ ImageLayerRenderingModel<TOutputImage> } } -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::Notify(ListenerType * listener) { // Notify the listener @@ -251,9 +251,9 @@ ImageLayerRenderingModel<TOutputImage> } -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::SetScaledExtractRegionCenter(const IndexType & index) { // Set the center of the scaled extract region @@ -263,9 +263,9 @@ ImageLayerRenderingModel<TOutputImage> m_ScaledExtractRegion.SetIndex(newIndex); } -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::SetExtractRegionCenter(const IndexType & index) { // Set the center of the extract region @@ -281,9 +281,9 @@ ImageLayerRenderingModel<TOutputImage> } -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::SetExtractRegionByIndex( const IndexType & startIndex, const IndexType & stopIndex ) { RegionType lImageRegion; @@ -307,9 +307,9 @@ ImageLayerRenderingModel<TOutputImage> } } -template <class TOutputImage> +template <class TOutputImage, class TLayer> unsigned int -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::GetSubsamplingRate() { if(this->GetNumberOfLayers() < 1) @@ -323,10 +323,10 @@ ImageLayerRenderingModel<TOutputImage> return baseLayer->GetQuicklookSubsamplingRate(); } -template <class TOutputImage> -typename ImageLayerRenderingModel<TOutputImage> +template <class TOutputImage, class TLayer> +typename ImageLayerRenderingModel<TOutputImage, TLayer> ::RegionType -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::ConstrainRegion(const RegionType & small, const RegionType & big) { RegionType resp = small; @@ -365,9 +365,9 @@ ImageLayerRenderingModel<TOutputImage> return resp; } -template <class TOutputImage> +template <class TOutputImage, class TLayer> void -ImageLayerRenderingModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage, TLayer> ::PrintSelf(std::ostream& os, itk::Indent indent) const { // Call superclass implementation diff --git a/Testing/Code/IO/CMakeLists.txt b/Testing/Code/IO/CMakeLists.txt index b3250947ec677a07bd31da22545eafb332a97b08..6d57d324ca2e591ecc78e3069d380151f0696eea 100755 --- a/Testing/Code/IO/CMakeLists.txt +++ b/Testing/Code/IO/CMakeLists.txt @@ -1357,58 +1357,6 @@ ADD_TEST(ioTvSpatialObjectDXFReader ${IO_TESTS11} # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbIOTESTS12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# ------- metadatas OSSIM reading tests ------------------------ - -# --- Quickbird Metadata --- -IF(OTB_DATA_USE_LARGEINPUT) -ADD_TEST(ioTvOSSIMImageQuickbirdMetaDataReader ${IO_TESTS12} - --compare-n-ascii ${EPS} 2 ${BASELINE_FILES}/ioOSSIMImageQuickbirdMetaDataReader.txt - ${TEMP}/ioOSSIMImageQuickbirdMetaDataReader.txt - ${BASELINE_FILES}/ioOSSIMImageQuickbirdMetaDataReader.txt - ${TEMP}/ioOSSIMImageQuickbirdMetaDataReader.txt - otbOSSIMImageMetaDataReaderTest - ${LARGEDATA}/TOULOUSE/QuickBird/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF - ${TEMP}/ioOSSIMImageQuickbirdMetaDataReader.txt - ${TEMP}/ioOSSIMImageQuickbirdMetaDataReader.txt - ) - -# --- Radarsat Metadata --- -ADD_TEST(ioTvOSSIMImageRadarsatMetaDataReader ${IO_TESTS12} - --compare-n-ascii ${EPS} 2 ${BASELINE_FILES}/ioOSSIMImageRadarsatMetaDataReader.txt - ${TEMP}/ioOSSIMImageRadarsatMetaDataReader.txt - ${BASELINE_FILES}/ioOSSIMImageRadarsatMetaDataReader.txt - ${TEMP}/ioOSSIMVectorImageRadarsatMetaDataReader.txt - otbOSSIMImageMetaDataReaderTest - ${LARGEDATA}/RADARSAT2/SCENE01/DAT_01.001 - ${TEMP}/ioOSSIMImageRadarsatMetaDataReader.txt - ${TEMP}/ioOSSIMVectorImageRadarsatMetaDataReader.txt - ) - -# --- ERS2 Metadata --- -ADD_TEST(ioTvOSSIMImageERS2MetaDataReader ${IO_TESTS12} - --compare-n-ascii ${EPS} 2 ${BASELINE_FILES}/ioOSSIMImageERS2MetaDataReader.txt - ${TEMP}/ioOSSIMImageERS2MetaDataReader.txt - ${BASELINE_FILES}/ioOSSIMImageERS2MetaDataReader.txt - ${TEMP}/ioOSSIMVectorImageERS2MetaDataReader.txt - otbOSSIMImageMetaDataReaderTest - ${LARGEDATA}/SAR_ERS2_SLCI_SCENE1/DAT_01.001 - ${TEMP}/ioOSSIMImageERS2MetaDataReader.txt - ${TEMP}/ioOSSIMVectorImageERS2MetaDataReader.txt - ) - -# --- SPOT4 Metadata --- -ADD_TEST(ioTvOSSIMImageSPOT5MetaDataReader ${IO_TESTS12} - --compare-n-ascii ${EPS} 2 ${BASELINE_FILES}/ioOSSIMImageSPOT5MetaDataReader.txt - ${TEMP}/ioOSSIMImageSPOT5MetaDataReader.txt - ${BASELINE_FILES}/ioOSSIMImageSPOT5MetaDataReader.txt - ${TEMP}/ioOSSIMVectorImageSPOT5MetaDataReader.txt - otbOSSIMImageMetaDataReaderTest - ${LARGEDATA}/SPOT5_SCENE01/IMAGERY.TIF - ${TEMP}/ioOSSIMImageSPOT5MetaDataReader.txt - ${TEMP}/ioOSSIMVectorImageSPOT5MetaDataReader.txt - ) -ENDIF(OTB_DATA_USE_LARGEINPUT) - # --- otb::DEMHandler --- ADD_TEST(ioTuDEMHandlerNew ${IO_TESTS12} otbDEMHandlerNew ) @@ -2041,8 +1989,6 @@ otbSpatialObjectDXFReader.cxx ) SET(BasicIO_SRCS12 otbIOTests12.cxx -#otbMultiToMonoChannelExtractROISAR.cxx -otbOSSIMImageMetaDataReaderTest.cxx otbDEMHandlerNew.cxx otbDEMHandlerTest.cxx otbDEMToImageGeneratorNew.cxx diff --git a/Testing/Code/IO/otbIOTests12.cxx b/Testing/Code/IO/otbIOTests12.cxx index 69f54463e7eedd71d18394219552697df20a4911..f861ad8a23c699ab1f90d986a3ce0638a78adc53 100644 --- a/Testing/Code/IO/otbIOTests12.cxx +++ b/Testing/Code/IO/otbIOTests12.cxx @@ -28,15 +28,14 @@ void RegisterTests() { - REGISTER_TEST(otbOSSIMImageMetaDataReaderTest); - REGISTER_TEST(otbDEMHandlerNew); - REGISTER_TEST(otbDEMHandlerTest); - REGISTER_TEST(otbDEMToImageGeneratorNew); - REGISTER_TEST(otbDEMToImageGeneratorTest); - REGISTER_TEST(otbOssimElevManagerTest); - REGISTER_TEST(otbOssimElevManagerTest2); - REGISTER_TEST(otbDEMToOrthoImageGeneratorNew); - REGISTER_TEST(otbDEMToOrthoImageGeneratorTest); - REGISTER_TEST(otbPrepareSRTMDirectoryNew); - REGISTER_TEST(otbPrepareSRTMDirectoryTest); +REGISTER_TEST(otbDEMHandlerNew); +REGISTER_TEST(otbDEMHandlerTest); +REGISTER_TEST(otbDEMToImageGeneratorNew); +REGISTER_TEST(otbDEMToImageGeneratorTest); +REGISTER_TEST(otbOssimElevManagerTest); +REGISTER_TEST(otbOssimElevManagerTest2); +REGISTER_TEST(otbDEMToOrthoImageGeneratorNew); +REGISTER_TEST(otbDEMToOrthoImageGeneratorTest); +REGISTER_TEST(otbPrepareSRTMDirectoryNew); +REGISTER_TEST(otbPrepareSRTMDirectoryTest); } diff --git a/Testing/Code/IO/otbOSSIMImageMetaDataReaderTest.cxx b/Testing/Code/IO/otbOSSIMImageMetaDataReaderTest.cxx deleted file mode 100644 index 5a465b908559681b5d37e8cdc7d9df85cf458f06..0000000000000000000000000000000000000000 --- a/Testing/Code/IO/otbOSSIMImageMetaDataReaderTest.cxx +++ /dev/null @@ -1,107 +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. - -=========================================================================*/ - -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - -#include "itkExceptionObject.h" -#include "itkBinaryMedianImageFilter.h" - -#include <iostream> - -#include "otbImage.h" -#include "otbVectorImage.h" - -#include "otbImageFileReader.h" -#include "otbImageKeywordlist.h" - -int otbOSSIMImageMetaDataReaderTest (int argc, char* argv[]) -{ - // Verify the number of parameters in the command line - const char * inputFilename = argv[1]; - const char * outputAsciiFilenameOtbImage = argv[2]; - const char * outputAsciiFilenameOtbVectorImage = argv[3]; - - typedef unsigned char InputPixelType; - typedef unsigned char OutputPixelType; - const unsigned int Dimension = 2; - - typedef otb::Image< InputPixelType, Dimension > InputImageType; - typedef otb::ImageFileReader< InputImageType > ImageReaderType; - - ImageReaderType::Pointer image_reader = ImageReaderType::New(); - image_reader->SetFileName( inputFilename ); - - typedef itk::BinaryMedianImageFilter<InputImageType,InputImageType> MedianFilterType; - MedianFilterType::Pointer image_medianFilter = MedianFilterType::New(); - - - image_medianFilter->SetInput(image_reader->GetOutput()); - image_medianFilter->GetOutput()->UpdateOutputInformation(); - - otb::ImageKeywordlist otb_tmp_image; - /* itk::ExposeMetaData< otb::ImageKeywordlist >(image_medianFilter->GetOutput()->GetMetaDataDictionary(), - otb::MetaDataKey::OSSIMKeywordlistKey, - otb_tmp_image);*/ - - otb_tmp_image = image_reader->GetOutput()->GetImageKeywordlist(); - - if(otb_tmp_image.GetSize()==0) - { - return EXIT_FAILURE; - } - - ossimKeywordlist ossim_kwl_image; - otb_tmp_image.convertToOSSIMKeywordlist(ossim_kwl_image); - - std::cout << " -> otbImage Ossim key word list copy : "<<ossim_kwl_image<<std::endl; - - std::ofstream file; - file.open(outputAsciiFilenameOtbImage); - file << "--- OSSIM KEYWORDLIST ---" << std::endl; - file << ossim_kwl_image; - file.close(); - - typedef otb::VectorImage< InputPixelType, Dimension > InputVectorImageType; - typedef otb::ImageFileReader< InputVectorImageType > VectorImageReaderType; - - VectorImageReaderType::Pointer vector_image_reader = VectorImageReaderType::New(); - vector_image_reader->SetFileName( inputFilename ); - vector_image_reader->GenerateOutputInformation (); - - /* itk::ExposeMetaData< otb::ImageKeywordlist >(vector_image_reader->GetOutput()->GetMetaDataDictionary(), - otb::MetaDataKey::OSSIMKeywordlistKey, - otb_tmp_vector_image);*/ - otb::ImageKeywordlist otb_tmp_vector_image; - otb_tmp_vector_image = vector_image_reader->GetOutput()->GetImageKeywordlist(); - - ossimKeywordlist ossim_kwl_vector_image; - otb_tmp_vector_image.convertToOSSIMKeywordlist(ossim_kwl_vector_image); - - std::cout << " -> otbVectorImage Ossim key word list copy : "<<ossim_kwl_vector_image<<std::endl; - - // std::ofstream file; - file.open(outputAsciiFilenameOtbVectorImage); - file << "--- OSSIM KEYWORDLIST ---" << std::endl; - file << ossim_kwl_vector_image; - file.close(); - - - return EXIT_SUCCESS; -} diff --git a/Testing/Code/MultiScale/CMakeLists.txt b/Testing/Code/MultiScale/CMakeLists.txt index d8c8508d96113b3f3642ba131ee734ce0755dd25..777cff7411ecae1d5fe6fecbc6edbfb8fee81ef8 100644 --- a/Testing/Code/MultiScale/CMakeLists.txt +++ b/Testing/Code/MultiScale/CMakeLists.txt @@ -8,7 +8,8 @@ SET(TEMP ${OTBTesting_BINARY_DIR}/Temporary) #Tolerance sur diff pixel image SET(TOL 0.0) -SET(EPSILON 0.00000001) +SET(EPSILON6 0.000001) +SET(EPSILON8 0.00000001) SET(MULTISCALE_TESTS1 ${CXX_TEST_PATH}/otbMultiScaleTests1) @@ -25,7 +26,7 @@ ADD_TEST(msTuMorphoPyrResamplerNew ${MULTISCALE_TESTS1} otbMorphologicalPyramidResamplerNew) ADD_TEST(msTvMorphoPyrResampler ${MULTISCALE_TESTS1} - --compare-n-images ${EPSILON} 2 + --compare-n-images ${EPSILON8} 2 ${BASELINE}/msPyrResampler_IKO_LesHalles_256_2.hdr ${TEMP}/msPyrResampler_IKO_LesHalles_256_2.hdr ${BASELINE}/msPyrResampler_IKO_LesHalles_full.hdr @@ -83,7 +84,7 @@ ADD_TEST(msTuMorphoPyrMRToMSConverterNew ${MULTISCALE_TESTS1} otbMorphologicalPyramidMRToMSConverterNew) ADD_TEST(msTvMorphoPyrMRToMSConverter ${MULTISCALE_TESTS1} - --compare-n-images ${EPSILON} 3 + --compare-n-images ${EPSILON8} 3 ${BASELINE}/msPyrMRToMS_IKO_Halles_4_2_sf_full.hdr ${TEMP}/msPyrMRToMS_IKO_Halles_4_2_sf_full.hdr ${BASELINE}/msPyrMRToMS_IKO_Halles_4_2_if_full.hdr @@ -359,13 +360,13 @@ ADD_TEST(msTvGeodesicMorphologyIterativeDecompositionImageFilter ${MULTISCALE_TE # ------- otb::WaveletOperator ---------- -ADD_TEST(msTuWaveletOperatorNew ${MULTISCALE_TESTS4} +ADD_TEST(msTuWaveletOperatorNew ${MULTISCALE_TESTS4} otbWaveletOperatorNew ) # Further tests ar skiped for the moment due to unexpected "Multiple Defined" errors... #IF(DESACTIVATED_FOR_NOW) -ADD_TEST(msTuWaveletOperator ${MULTISCALE_TESTS4} +ADD_TEST(msTuWaveletOperator ${MULTISCALE_TESTS4} otbWaveletOperator ) # ------- otb::WaveletFilterBankNew ---------- @@ -376,7 +377,7 @@ ADD_TEST(msTuWaveletInverseFilterBankNew ${MULTISCALE_TESTS4} otbWaveletInverseFilterBankNew) ADD_TEST(msTvWaveletFilterBank ${MULTISCALE_TESTS4} - --compare-image ${TOL} + --compare-image ${TOL} ${INPUTDATA}/ROI_IKO_PAN_LesHalles.tif ${TEMP}/ROI_IKO_PAN_LesHalles_FilterBank.tif otbWaveletFilterBank @@ -386,7 +387,7 @@ ADD_TEST(msTvWaveletFilterBank ${MULTISCALE_TESTS4} ) ADD_TEST(msTvWaveletMultiScaleFilterBank ${MULTISCALE_TESTS4} - --compare-image ${TOL} + --compare-image ${EPSILON6} ${INPUTDATA}/ROI_IKO_PAN_LesHalles.tif ${TEMP}/ROI_IKO_PAN_LesHalles_FilterBankMultiScale.tif otbWaveletFilterBank @@ -403,7 +404,7 @@ ADD_TEST(msTuWaveletInverseTransformNew ${MULTISCALE_TESTS4} otbWaveletInverseTransformNew) ADD_TEST(msTvWaveletTransform ${MULTISCALE_TESTS4} - --compare-image ${TOL} + --compare-image ${EPSILON6} ${INPUTDATA}/ROI_IKO_PAN_LesHalles.tif ${TEMP}/ROI_IKO_PAN_LesHalles_Wvlt.tif otbWaveletTransform @@ -413,7 +414,7 @@ ADD_TEST(msTvWaveletTransform ${MULTISCALE_TESTS4} ) ADD_TEST(msTvWaveletMultiScaleTransform ${MULTISCALE_TESTS4} - --compare-image ${TOL} + --compare-image ${TOL} ${INPUTDATA}/ROI_IKO_PAN_LesHalles.tif ${TEMP}/ROI_IKO_PAN_LesHalles_WvltMultiScale.tif otbWaveletTransform @@ -430,7 +431,7 @@ ADD_TEST(msTuWaveletPacketInverseTransformNew ${MULTISCALE_TESTS4} otbWaveletPacketInverseTransformNew) ADD_TEST(msTvWaveletPacketTransform ${MULTISCALE_TESTS4} - --compare-image ${TOL} + --compare-image ${EPSILON6} ${INPUTDATA}/ROI_IKO_PAN_LesHalles.tif ${TEMP}/ROI_IKO_PAN_LesHalles_WvltPacket.tif otbWaveletPacketTransform @@ -440,7 +441,7 @@ ADD_TEST(msTvWaveletPacketTransform ${MULTISCALE_TESTS4} ) ADD_TEST(msTvWaveletPacketMultiScaleTransform ${MULTISCALE_TESTS4} - --compare-image ${TOL} + --compare-image ${EPSILON6} ${INPUTDATA}/ROI_IKO_PAN_LesHalles.tif ${TEMP}/ROI_IKO_PAN_LesHalles_WvltPacketMultiScale.tif otbWaveletPacketTransform diff --git a/Testing/Code/Visualization/otbImageLayerRenderingModelSingleLayer.cxx b/Testing/Code/Visualization/otbImageLayerRenderingModelSingleLayer.cxx index f425d4b9ec5f3ab45bdec467c4a770982bd20285..e384a4736d008891eb9f0af7cf6a5334c739b38a 100644 --- a/Testing/Code/Visualization/otbImageLayerRenderingModelSingleLayer.cxx +++ b/Testing/Code/Visualization/otbImageLayerRenderingModelSingleLayer.cxx @@ -134,7 +134,12 @@ int otbImageLayerRenderingModelSingleLayer( int argc, char * argv[] ) std::cout<<"Scaled extract saved."<<std::endl; // Layer manipulation test - model->GetLayerByName(layerName); + model->DeleteLayerByName(layerName); + model->AddLayer(generator->GetLayer()); + model->AddLayer(generator->GetLayer()); + model->DeleteLayer(0); + model->DeleteLayer(0); + model->ClearLayers(); return EXIT_SUCCESS; } diff --git a/Utilities/otbossim/CMakeLists.txt b/Utilities/otbossim/CMakeLists.txt index 8b81e58d72062fe1b5b47702a0b7168d186d061c..f66550abd22703f8ae7dda2fabf46a14cc5dd93a 100644 --- a/Utilities/otbossim/CMakeLists.txt +++ b/Utilities/otbossim/CMakeLists.txt @@ -23,8 +23,192 @@ CONFIGURE_FILE(${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim/ossimConfig.h. -SUBDIRS(include) +# SUBDIRS(include) # ADDED BY OTB DEVELOPPERS TO AVOID INTENSIVE RECOMPILATION IF(NOT OTB_DISABLE_UTILITIES_COMPILATION) -SUBDIRS(src) + + FILE(GLOB_RECURSE ossim_init_SRCS "src/ossim/init/*.cpp" "src/ossim/init/*.c") + FILE(GLOB_RECURSE ossim_base_SRCS "src/ossim/base/*.cpp" "src/ossim/base/*.c") + FILE(GLOB_RECURSE ossim_elevation_SRCS "src/ossim/elevation/*.cpp" "src/ossim/elevation/*.c") + FILE(GLOB_RECURSE ossim_font_SRCS "src/ossim/font/*.cpp" "src/ossim/font/*.c") + FILE(GLOB_RECURSE ossim_imaging_SRCS "src/ossim/imaging/*.cpp" "src/ossim/imaging/*.c") + FILE(GLOB_RECURSE ossim_matrix_SRCS "src/ossim/matrix/*.cpp" "src/ossim/matrix/*.c") + FILE(GLOB_RECURSE ossim_parallel_SRCS "src/ossim/parallel/*.cpp" "src/ossim/parallel/*.c") + FILE(GLOB_RECURSE ossim_projection_SRCS "src/ossim/projection/*.cpp" "src/ossim/projection/*.c") + FILE(GLOB_RECURSE ossim_support_data_SRCS "src/ossim/support_data/*.cpp" "src/ossim/support_data/*.c") + FILE(GLOB_RECURSE ossim_vec_SRCS "src/ossim/vec/*.cpp" "src/ossim/vec/*.c") + FILE(GLOB_RECURSE ossim_vpfutil_SRCS "src/ossim/vpfutil/*.cpp" "src/ossim/vpfutil/*.c") + FILE(GLOB_RECURSE ossim_plugin_SRCS "src/ossim/plugin/*.cpp" "src/ossim/plugin/*.c") + FILE(GLOB_RECURSE ossim_kbool_SRCS "src/ossim/kbool/*.cpp" "src/ossim/kbool/*.c") + FILE(GLOB_RECURSE ossim_dll_main_SRCS "src/ossim/dll_main/*.cpp") + + # Removing empty source file causing compilation warning on visual + REMOVE(ossim_support_data_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/ossim/support_data/ossimDemPoint.cpp") + REMOVE(ossim_plugin_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/ossim/plugin/ossimSharedObjectBridge.cpp") + REMOVE(ossim_base_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/ossim/base/ossimFactoryBaseTemplate.cpp") + + # Removing sources not in use any more (switched to ossim plugins) + REMOVE(ossim_imaging_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/ossim/imaging/ErsSar/*") + REMOVE(ossim_imaging_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/ossim/imaging/RadarSat2/*") + + # Adjust the compiler flags to avoid problems with ossim code. + IF(CMAKE_COMPILER_IS_GNUCXX) + FOREACH(f ${ossim_base_SRCS} ${ossim_elevation_SRCS} ${ossim_font_SRCS} ${ossim_imaging_SRCS} ${ossim_matrix_SRCS} + ${ossim_parallel_SRCS} ${ossim_projection_SRCS} ${ossim_support_data_SRCS} + ${ossim_vec_SRCS} ${ossim_vpfutil_SRCS} ${ossim_plugin_SRCS} ${ossim_init_SRCS} + ${ossim_kbool_SRCS} ${ossim_dll_main_SRCS} ) + SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES COMPILE_FLAGS -w ) + ENDFOREACH(f) + ELSE(CMAKE_COMPILER_IS_GNUCXX) + IF(NOT BORLAND) + IF(NOT CYGWIN) + IF(NOT MINGW) + FOREACH(f ${ossim_base_SRCS} ${ossim_elevation_SRCS} ${ossim_font_SRCS} ${ossim_imaging_SRCS} ${ossim_matrix_SRCS} + ${ossim_parallel_SRCS} ${ossim_projection_SRCS} ${ossim_support_data_SRCS} + ${ossim_vec_SRCS} ${ossim_vpfutil_SRCS} ${ossim_plugin_SRCS} ${ossim_init_SRCS} + ${ossim_kbool_SRCS} ${ossim_dll_main_SRCS} ) + SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES COMPILE_FLAGS /W0 ) + ENDFOREACH(f) + ENDIF(NOT MINGW) + ENDIF(NOT CYGWIN) + ENDIF(NOT BORLAND) + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + + IF(WIN32) + IF(NOT BORLAND) + IF(NOT CYGWIN) + IF(NOT MINGW) + SET(ossim_init_SRCS ${ossim_init_SRCS} ${ossim_dll_main_SRCS}) + ENDIF(NOT MINGW) + ENDIF(NOT CYGWIN) + ENDIF(NOT BORLAND) + ENDIF(WIN32) + + + ADD_EXECUTABLE(version-config src/ossim/version-config.cpp) + #FIND_PROGRAM( VERSION_CONFIG_PROGRAM + # NAMES version-config + # PATHS ${EXECUTABLE_OUTPUT_PATH} + # ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE} + # ${EXECUTABLE_OUTPUT_PATH}/Release + # ${EXECUTABLE_OUTPUT_PATH}/Debug + # ${EXECUTABLE_OUTPUT_PATH}/MinSizeRel + # ${EXECUTABLE_OUTPUT_PATH}/RelWithDebInfo + # NO_DEFAULT_PATH ) + + + IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" MATCHES "^2\\.4$") + ADD_CUSTOM_COMMAND( + OUTPUT ${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h + COMMAND ${OTB_BINARY_DIR}/bin/version-config + ARGS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h" "${OSSIM_VERSION}" + DEPENDS version-config + COMMENT "Generating ossimVersion.h" ) + ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" MATCHES "^2\\.4$") + ADD_CUSTOM_COMMAND( + OUTPUT ${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h + COMMAND ${OTB_BINARY_DIR}/bin/version-config + ARGS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h" "${OSSIM_VERSION}" + DEPENDS version-config + COMMENT "Generating ossimVersion.h" ) + ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" MATCHES "^2\\.4$") + + + + SET_SOURCE_FILES_PROPERTIES( + src/ossim/init/ossimInit.cpp PROPERTIES + OBJECT_DEPENDS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h" + ) + + #Specify that we are making DLL here + ADD_DEFINITIONS(-DNOMINMAX -DOSSIMMAKINGDLL) + + ADD_LIBRARY(otbossim + ${ossim_init_SRCS} + ${ossim_base_SRCS} + ${ossim_kbool_SRCS} + ${ossim_matrix_SRCS} + ${ossim_vec_SRCS} + ${ossim_vpfutil_SRCS} + ${ossim_plugin_SRCS} + ${ossim_font_SRCS} + ${ossim_support_data_SRCS} + ${ossim_projection_SRCS} + ${ossim_imaging_SRCS} + ${ossim_parallel_SRCS} + ${ossim_elevation_SRCS} + ) + TARGET_LINK_LIBRARIES(otbossim ${TIFF_LIBRARY} ${GEOTIFF_LIBRARY} ${JPEG_LIBRARY} ${OPENTHREADS_LIBRARY}) + + IF(NOT OTB_INSTALL_NO_LIBRARIES) + INSTALL(TARGETS otbossim + RUNTIME DESTINATION ${OTB_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries + LIBRARY DESTINATION ${OTB_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries + ARCHIVE DESTINATION ${OTB_INSTALL_LIB_DIR_CM24} COMPONENT Development) + ENDIF(NOT OTB_INSTALL_NO_LIBRARIES) + ENDIF(NOT OTB_DISABLE_UTILITIES_COMPILATION) + +FILE(GLOB ossim_base_HDRS "include/ossim/base/*.h") +FILE(GLOB ossim_elevation_HDRS "include/ossim/elevation/*.h") +FILE(GLOB ossim_font_HDRS "include/ossim/font/*.h") +FILE(GLOB_RECURSE ossim_imaging_HDRS "include/ossim/imaging/*.h") +FILE(GLOB ossim_init_HDRS "include/ossim/init/*.h") +FILE(GLOB ossim_kbool_HDRS "include/ossim/kbool/*.h") +FILE(GLOB ossim_matrix_HDRS "include/ossim/matrix/*.h") +FILE(GLOB ossim_parallel_HDRS "include/ossim/parallel/*.h") +FILE(GLOB ossim_plugin_HDRS "include/ossim/plugin/*.h") +FILE(GLOB_RECURSE ossim_projection_HDRS "include/ossim/projection/*.h") +FILE(GLOB ossim_support_data_HDRS "include/ossim/support_data/*.h") +FILE(GLOB ossim_vec_HDRS "include/ossim/vec/*.h") +FILE(GLOB ossim_vpfutil_HDRS "include/ossim/vpfutil/*.h") + +IF(NOT OTB_INSTALL_NO_DEVELOPMENT) + +INSTALL(FILES ${ossim_base_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/base + COMPONENT Development) +INSTALL(FILES ${ossim_elevation_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/elevation + COMPONENT Development) +INSTALL(FILES ${ossim_font_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/font + COMPONENT Development) +INSTALL(FILES ${ossim_imaging_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/imaging + COMPONENT Development) +INSTALL(FILES ${ossim_init_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/init + COMPONENT Development) +INSTALL(FILES ${ossim_kbool_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/kbool + COMPONENT Development) +INSTALL(FILES ${ossim_matrix_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/matrix + COMPONENT Development) +INSTALL(FILES ${ossim_parallel_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/parallel + COMPONENT Development) +INSTALL(FILES ${ossim_plugin_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/plugin + COMPONENT Development) +INSTALL(FILES ${ossim_projection_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/projection + COMPONENT Development) +INSTALL(FILES ${ossim_support_data_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/support_data + COMPONENT Development) +INSTALL(FILES ${ossim_vec_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/vec + COMPONENT Development) +INSTALL(FILES ${ossim_vpfutil_HDRS} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/vpfutil + COMPONENT Development) + +SET(ossim_config_HDR "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimConfig.h" ) + +INSTALL(FILES ${ossim_config_HDR} + DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim + COMPONENT Development) + +ENDIF(NOT OTB_INSTALL_NO_DEVELOPMENT) \ No newline at end of file diff --git a/Utilities/otbossim/include/CMakeLists.txt b/Utilities/otbossim/include/CMakeLists.txt deleted file mode 100644 index ac3ce0bdd9d311c73098be498f58ce21f479642f..0000000000000000000000000000000000000000 --- a/Utilities/otbossim/include/CMakeLists.txt +++ /dev/null @@ -1,63 +0,0 @@ -FILE(GLOB ossim_base_HDRS "ossim/base/*.h") -FILE(GLOB ossim_elevation_HDRS "ossim/elevation/*.h") -FILE(GLOB ossim_font_HDRS "ossim/font/*.h") -FILE(GLOB_RECURSE ossim_imaging_HDRS "ossim/imaging/*.h") -FILE(GLOB ossim_init_HDRS "ossim/init/*.h") -FILE(GLOB ossim_kbool_HDRS "ossim/kbool/*.h") -FILE(GLOB ossim_matrix_HDRS "ossim/matrix/*.h") -FILE(GLOB ossim_parallel_HDRS "ossim/parallel/*.h") -FILE(GLOB ossim_plugin_HDRS "ossim/plugin/*.h") -FILE(GLOB_RECURSE ossim_projection_HDRS "ossim/projection/*.h") -FILE(GLOB ossim_support_data_HDRS "ossim/support_data/*.h") -FILE(GLOB ossim_vec_HDRS "ossim/vec/*.h") -FILE(GLOB ossim_vpfutil_HDRS "ossim/vpfutil/*.h") - -IF(NOT OTB_INSTALL_NO_DEVELOPMENT) - -INSTALL(FILES ${ossim_base_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/base - COMPONENT Development) -INSTALL(FILES ${ossim_elevation_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/elevation - COMPONENT Development) -INSTALL(FILES ${ossim_font_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/font - COMPONENT Development) -INSTALL(FILES ${ossim_imaging_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/imaging - COMPONENT Development) -INSTALL(FILES ${ossim_init_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/init - COMPONENT Development) -INSTALL(FILES ${ossim_kbool_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/kbool - COMPONENT Development) -INSTALL(FILES ${ossim_matrix_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/matrix - COMPONENT Development) -INSTALL(FILES ${ossim_parallel_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/parallel - COMPONENT Development) -INSTALL(FILES ${ossim_plugin_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/plugin - COMPONENT Development) -INSTALL(FILES ${ossim_projection_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/projection - COMPONENT Development) -INSTALL(FILES ${ossim_support_data_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/support_data - COMPONENT Development) -INSTALL(FILES ${ossim_vec_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/vec - COMPONENT Development) -INSTALL(FILES ${ossim_vpfutil_HDRS} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim/vpfutil - COMPONENT Development) - -SET(ossim_config_HDR "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimConfig.h" ) - -INSTALL(FILES ${ossim_config_HDR} - DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/Utilities/otbossim/include/ossim - COMPONENT Development) - -ENDIF(NOT OTB_INSTALL_NO_DEVELOPMENT) diff --git a/Utilities/otbossim/src/CMakeLists.txt b/Utilities/otbossim/src/CMakeLists.txt deleted file mode 100644 index 39bc7c472c4218a675aca223c07ebf5b5c92aa0c..0000000000000000000000000000000000000000 --- a/Utilities/otbossim/src/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS(ossim) diff --git a/Utilities/otbossim/src/ossim/CMakeLists.txt b/Utilities/otbossim/src/ossim/CMakeLists.txt deleted file mode 100644 index 6da08c50311f44a9a9bbed330484e39a5e9d311d..0000000000000000000000000000000000000000 --- a/Utilities/otbossim/src/ossim/CMakeLists.txt +++ /dev/null @@ -1,117 +0,0 @@ -FILE(GLOB_RECURSE ossim_init_SRCS "init/*.cpp" "init/*.c") -FILE(GLOB_RECURSE ossim_base_SRCS "base/*.cpp" "base/*.c") -FILE(GLOB_RECURSE ossim_elevation_SRCS "elevation/*.cpp" "elevation/*.c") -FILE(GLOB_RECURSE ossim_font_SRCS "font/*.cpp" "font/*.c") -FILE(GLOB_RECURSE ossim_imaging_SRCS "imaging/*.cpp" "imaging/*.c") -FILE(GLOB_RECURSE ossim_matrix_SRCS "matrix/*.cpp" "matrix/*.c") -FILE(GLOB_RECURSE ossim_parallel_SRCS "parallel/*.cpp" "parallel/*.c") -FILE(GLOB_RECURSE ossim_projection_SRCS "projection/*.cpp" "projection/*.c") -FILE(GLOB_RECURSE ossim_support_data_SRCS "support_data/*.cpp" "support_data/*.c") -FILE(GLOB_RECURSE ossim_vec_SRCS "vec/*.cpp" "vec/*.c") -FILE(GLOB_RECURSE ossim_vpfutil_SRCS "vpfutil/*.cpp" "vpfutil/*.c") -FILE(GLOB_RECURSE ossim_plugin_SRCS "plugin/*.cpp" "plugin/*.c") -FILE(GLOB_RECURSE ossim_kbool_SRCS "kbool/*.cpp" "kbool/*.c") -FILE(GLOB_RECURSE ossim_dll_main_SRCS "dll_main/*.cpp") - -# Removing empty source file causing compilation warning on visual -REMOVE(ossim_support_data_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/support_data/ossimDemPoint.cpp") -REMOVE(ossim_plugin_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/plugin/ossimSharedObjectBridge.cpp") -REMOVE(ossim_base_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/base/ossimFactoryBaseTemplate.cpp") -REMOVE(ossim_imaging_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/imaging/ErsSar/*") -REMOVE(ossim_imaging_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/imaging/RadarSat2/*") - -# Adjust the compiler flags to avoid problems with ossim code. -IF(CMAKE_COMPILER_IS_GNUCXX) - FOREACH(f ${ossim_base_SRCS} ${ossim_elevation_SRCS} ${ossim_font_SRCS} ${ossim_imaging_SRCS} ${ossim_matrix_SRCS} - ${ossim_parallel_SRCS} ${ossim_projection_SRCS} ${ossim_support_data_SRCS} - ${ossim_vec_SRCS} ${ossim_vpfutil_SRCS} ${ossim_plugin_SRCS} ${ossim_init_SRCS} - ${ossim_kbool_SRCS} ${ossim_dll_main_SRCS} ) - SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES COMPILE_FLAGS -w ) - ENDFOREACH(f) -ELSE(CMAKE_COMPILER_IS_GNUCXX) - IF(NOT BORLAND) - IF(NOT CYGWIN) - IF(NOT MINGW) - FOREACH(f ${ossim_base_SRCS} ${ossim_elevation_SRCS} ${ossim_font_SRCS} ${ossim_imaging_SRCS} ${ossim_matrix_SRCS} - ${ossim_parallel_SRCS} ${ossim_projection_SRCS} ${ossim_support_data_SRCS} - ${ossim_vec_SRCS} ${ossim_vpfutil_SRCS} ${ossim_plugin_SRCS} ${ossim_init_SRCS} - ${ossim_kbool_SRCS} ${ossim_dll_main_SRCS} ) - SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES COMPILE_FLAGS /W0 ) - ENDFOREACH(f) - ENDIF(NOT MINGW) - ENDIF(NOT CYGWIN) - ENDIF(NOT BORLAND) -ENDIF(CMAKE_COMPILER_IS_GNUCXX) - -IF(WIN32) - IF(NOT BORLAND) - IF(NOT CYGWIN) - IF(NOT MINGW) - SET(ossim_init_SRCS ${ossim_init_SRCS} ${ossim_dll_main_SRCS}) - ENDIF(NOT MINGW) - ENDIF(NOT CYGWIN) - ENDIF(NOT BORLAND) -ENDIF(WIN32) - - -ADD_EXECUTABLE(version-config version-config.cpp) -#FIND_PROGRAM( VERSION_CONFIG_PROGRAM -# NAMES version-config -# PATHS ${EXECUTABLE_OUTPUT_PATH} -# ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE} -# ${EXECUTABLE_OUTPUT_PATH}/Release -# ${EXECUTABLE_OUTPUT_PATH}/Debug -# ${EXECUTABLE_OUTPUT_PATH}/MinSizeRel -# ${EXECUTABLE_OUTPUT_PATH}/RelWithDebInfo -# NO_DEFAULT_PATH ) - - -IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" MATCHES "^2\\.4$") - ADD_CUSTOM_COMMAND( - OUTPUT ${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h - COMMAND ${OTB_BINARY_DIR}/bin/version-config - ARGS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h" "${OSSIM_VERSION}" - DEPENDS version-config - COMMENT "Generating ossimVersion.h" ) -ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" MATCHES "^2\\.4$") - ADD_CUSTOM_COMMAND( - OUTPUT ${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h - COMMAND version-config - ARGS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h" "${OSSIM_VERSION}" - DEPENDS version-config - COMMENT "Generating ossimVersion.h" ) -ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" MATCHES "^2\\.4$") - - - -SET_SOURCE_FILES_PROPERTIES( - init/ossimInit.cpp PROPERTIES - OBJECT_DEPENDS "${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim/ossimVersion.h" - ) - -#Specify that we are making DLL here -ADD_DEFINITIONS(-DNOMINMAX -DOSSIMMAKINGDLL) - -ADD_LIBRARY(otbossim -${ossim_init_SRCS} -${ossim_base_SRCS} -${ossim_kbool_SRCS} -${ossim_matrix_SRCS} -${ossim_vec_SRCS} -${ossim_vpfutil_SRCS} -${ossim_plugin_SRCS} -${ossim_font_SRCS} -${ossim_support_data_SRCS} -${ossim_projection_SRCS} -${ossim_imaging_SRCS} -${ossim_parallel_SRCS} -${ossim_elevation_SRCS} -) -TARGET_LINK_LIBRARIES(otbossim ${TIFF_LIBRARY} ${GEOTIFF_LIBRARY} ${JPEG_LIBRARY} ${OPENTHREADS_LIBRARY}) - -IF(NOT OTB_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS otbossim - RUNTIME DESTINATION ${OTB_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${OTB_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${OTB_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT OTB_INSTALL_NO_LIBRARIES)