diff --git a/Code/VisuRefac/otbChangeExtractRegionActionHandler.h b/Code/VisuRefac/otbChangeExtractRegionActionHandler.h index e217038239807fb4ff504e9dcf3b6c004905a3ab..eb3ed7adc88dc1705a7a9a79c48462d7db025493 100644 --- a/Code/VisuRefac/otbChangeExtractRegionActionHandler.h +++ b/Code/VisuRefac/otbChangeExtractRegionActionHandler.h @@ -74,7 +74,7 @@ public: index[0] = Fl::event_x(); index[1] = Fl::event_y(); // Change scaled extract region center - m_Model->SetExtractRegionSubsampledCenter(m_View->GetScrollWidget()->ScreenIndexToRegionIndex(index)); + m_Model->SetExtractRegionCenter(m_View->GetScrollWidget()->ScreenIndexToImageIndex(index)); // Update model m_Model->Update(); return true; diff --git a/Code/VisuRefac/otbImageLayer.h b/Code/VisuRefac/otbImageLayer.h index f1d99564530a6f30d02714502230f668020ad274..445b7a22b3e494444dbf2d006e50701ebdaa1085 100644 --- a/Code/VisuRefac/otbImageLayer.h +++ b/Code/VisuRefac/otbImageLayer.h @@ -18,7 +18,7 @@ #ifndef __otbImageLayer_h #define __otbImageLayer_h -#include "otbLayer.h" +#include "otbImageLayerBase.h" #include "itkVariableLengthVector.h" #include "itkDenseFrequencyContainer.h" #include "otbRenderingImageFilter.h" @@ -39,12 +39,12 @@ namespace otb template <class TImage, class TOutputImage = otb::Image<itk::RGBPixel<unsigned char>, 2 > > class ImageLayer - : public Layer<TOutputImage> + : public ImageLayerBase<TOutputImage> { public: /** Standard class typedefs */ typedef ImageLayer Self; - typedef Layer<TOutputImage> Superclass; + typedef ImageLayerBase<TOutputImage> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -183,7 +183,7 @@ public: virtual void Render(); /** Get the pixel description */ - std::string GetPixelDescription(const IndexType & index); + virtual std::string GetPixelDescription(const IndexType & index); protected: /** Constructor */ diff --git a/Code/VisuRefac/otbImageLayer.txx b/Code/VisuRefac/otbImageLayer.txx index a847783b01c0b1000dfb04634731f0d6a9753595..34caade42f33d8f0402b649a968db90e823b46e8 100644 --- a/Code/VisuRefac/otbImageLayer.txx +++ b/Code/VisuRefac/otbImageLayer.txx @@ -256,7 +256,7 @@ ImageLayer<TImage,TOutputImage> // If we are inside the buffered region if(m_Image->GetBufferedRegion().IsInside(index)) { - oss<<m_RenderingFunction->Describe(m_Image->GetPixel(index)); + oss<<" "<<m_RenderingFunction->Describe(m_Image->GetPixel(index)); } else if(m_Quicklook.IsNotNull()) // Else we extrapolate the value from the quicklook diff --git a/Code/VisuRefac/otbLayer.h b/Code/VisuRefac/otbImageLayerBase.h similarity index 90% rename from Code/VisuRefac/otbLayer.h rename to Code/VisuRefac/otbImageLayerBase.h index 5c24e1c827e0f0bc7e79b8827d8afe8c73a6c634..c7a77699d3cb80c94270bae19973dc357dbdd940 100644 --- a/Code/VisuRefac/otbLayer.h +++ b/Code/VisuRefac/otbImageLayerBase.h @@ -15,8 +15,8 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#ifndef __otbLayer_h -#define __otbLayer_h +#ifndef __otbImageLayerBase_h +#define __otbImageLayerBase_h #include "itkObject.h" #include "otbImage.h" @@ -26,7 +26,7 @@ namespace otb { -/** \class Layer +/** \class ImageLayerBase * \brief Base class for all layers objects * A layer is something that can be rendered to the screen. * @@ -34,24 +34,25 @@ namespace otb */ template <class TOutputImage = Image<itk::RGBPixel<unsigned char>, 2 > > -class Layer +class ImageLayerBase : public itk::Object { public: /** Standard class typedefs */ - typedef Layer Self; + typedef ImageLayerBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; /** Runtime information */ - itkTypeMacro(Layer,Object); + itkTypeMacro(ImageLayerBase,Object); /** Output image typedef */ typedef TOutputImage OutputImageType; typedef typename OutputImageType::Pointer OutputImagePointerType; typedef typename OutputImageType::RegionType RegionType; typedef typename RegionType::SizeType SizeType; + typedef typename RegionType::IndexType IndexType; typedef typename OutputImageType::PixelType PixelType; /** Blending function typedef */ @@ -61,6 +62,9 @@ public: /** Actually render the layer */ virtual void Render() = 0; + /** Get the pixel description */ + virtual std::string GetPixelDescription(const IndexType & index) = 0; + itkGetObjectMacro(RenderedQuicklook, OutputImageType); itkGetObjectMacro(RenderedExtract, OutputImageType); itkGetObjectMacro(RenderedScaledExtract, OutputImageType); @@ -114,7 +118,7 @@ public: protected: /** Constructor */ - Layer() : m_Name("Default"), m_Visible(false), m_Extent(), + ImageLayerBase() : m_Name("Default"), m_Visible(false), m_Extent(), m_RenderedQuicklook(), m_HasQuicklook(false), m_QuicklookSize(), m_QuicklookSubsamplingRate(1), m_RenderedExtract(), m_HasExtract(false), m_ExtractRegion(), m_RenderedScaledExtract(), m_HasScaledExtract(false), m_ScaledExtractRegion(), @@ -124,12 +128,12 @@ protected: m_BlendingFunction = Function::UniformAlphaBlendingFunction<PixelType>::New(); } /** Destructor */ - virtual ~Layer(){} + virtual ~ImageLayerBase(){} /** Printself method */ void PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os,indent); - os<<indent<<"Layer "<<m_Name<<":"<<std::endl; + os<<indent<<"ImageLayerBase "<<m_Name<<":"<<std::endl; os<<indent<<indent<<"Has a quicklook: " <<(m_HasQuicklook ? "true" : "false") << std::endl; os<<indent<<indent<<"Has an extract: " <<(m_HasExtract ? "true" : "false") << std::endl; os<<indent<<indent<<"Has a scaled extract: "<<(m_HasScaledExtract ? "true" : "false") << std::endl; @@ -141,7 +145,7 @@ protected: itkSetObjectMacro(RenderedScaledExtract, OutputImageType); private: - Layer(const Self&); // purposely not implemented + ImageLayerBase(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented /** The layer name */ diff --git a/Code/VisuRefac/otbImageViewerModel.h b/Code/VisuRefac/otbImageLayerRenderingModel.h similarity index 72% rename from Code/VisuRefac/otbImageViewerModel.h rename to Code/VisuRefac/otbImageLayerRenderingModel.h index ddd76c61cd48f2b98ae67571266993e29425df3d..3c19370e8d80bc07bc003c547bce045facff265a 100644 --- a/Code/VisuRefac/otbImageViewerModel.h +++ b/Code/VisuRefac/otbImageLayerRenderingModel.h @@ -15,19 +15,19 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#ifndef __otbImageViewerModel_h -#define __otbImageViewerModel_h +#ifndef __otbImageLayerRenderingModel_h +#define __otbImageLayerRenderingModel_h -#include "otbMVCModel.h" +#include "otbMVCModelBase.h" #include "otbLayerBasedModel.h" -#include "otbLayer.h" +#include "otbImageLayerBase.h" #include "otbObjectList.h" -#include "otbImageViewerModelListener.h" +#include "otbImageLayerRenderingModelListener.h" #include "otbBlendingImageFilter.h" namespace otb { -/** \class ImageViewerModel +/** \class ImageLayerRenderingModel * \brief This class is the model for ImageViewer. * It is in charge of rendering to the screen a set of Layer. * Each visible layer is rendered separately, and the resulting @@ -40,18 +40,18 @@ namespace otb */ template <class TOutputImage = otb::Image<itk::RGBPixel<unsigned char>,2 > > -class ImageViewerModel - : public MVCModel<ImageViewerModelListener>, public LayerBasedModel< Layer<TOutputImage> > +class ImageLayerRenderingModel + : public MVCModelBase<ImageLayerRenderingModelListener>, public LayerBasedModel< ImageLayerBase<TOutputImage> > { public: /** Standard class typedefs */ - typedef ImageViewerModel Self; - typedef LayerBasedModel< Layer<TOutputImage> > Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef ImageLayerRenderingModel Self; + typedef LayerBasedModel< ImageLayerBase <TOutputImage> > Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Runtime information */ - itkTypeMacro(ImageViewerModel,LayerBasedModel); + itkTypeMacro(ImageLayerRenderingModel,LayerBasedModel); /** New macro */ itkNewMacro(Self); @@ -71,7 +71,7 @@ public: typedef typename LayerListType::ConstIterator LayerIteratorType; /** Listener typedef */ - typedef ImageViewerModelListener ListenerType; + typedef ImageLayerRenderingModelListener ListenerType; /** Blending filter typedef */ typedef otb::BlendingImageFilter<OutputImageType> BlendingFilterType; @@ -81,30 +81,6 @@ public: typedef typename BlendingFilterListType::Pointer BlendingFilterListPointerType; typedef typename BlendingFilterListType::Iterator BlendingFilterIteratorType; - - /** Add a new layer - * \param layer The layer to add. - * \return The location of the added layer. - */ - virtual unsigned int AddLayer(LayerType * layer); - - /** Remove the layer at the current index - * \param index The index of the layer to remove. - * \return true if a layer was actually deleted, false otherwise. - * this location. - */ - virtual bool DeleteLayer(unsigned int index); - - /** Delete the first layer whose name matches the given name. - * \param name The name of the layer. - * \return true if a layer was actually deleted, false otherwise. - * this location. - */ - virtual bool DeleteLayerByName(std::string name); - - /** Clear all layers */ - virtual void ClearLayers(void); - /** Get/Set the viewer name */ itkGetStringMacro(Name); itkSetStringMacro(Name); @@ -118,8 +94,6 @@ public: /** Set/Get the Extract Region */ itkSetMacro(ExtractRegion,RegionType); itkGetConstReferenceMacro(ExtractRegion,RegionType); - /** Get the extract region in the quicklook space */ - itkGetConstReferenceMacro(SubsampledExtractRegion,RegionType); /** Set/Get the Scaled Extract Region */ itkSetMacro(ScaledExtractRegion,RegionType); @@ -141,16 +115,15 @@ public: /** Change the extract region by giving the center of the * region */ void SetExtractRegionCenter(const IndexType & index); - - /** Change the extract region by giving the subsamppled center - * of the region */ - void SetExtractRegionSubsampledCenter(const IndexType & index); + + /** Get the sumbsampling rate */ + unsigned int GetSubsamplingRate(); protected: /** Constructor */ - ImageViewerModel(); + ImageLayerRenderingModel(); /** Destructor */ - ~ImageViewerModel(); + ~ImageLayerRenderingModel(); /** Printself method */ void PrintSelf(std::ostream& os, itk::Indent indent) const; @@ -168,7 +141,7 @@ protected: RegionType ConstrainRegion(const RegionType & region, const RegionType & largest); private: - ImageViewerModel(const Self&); // purposely not implemented + ImageLayerRenderingModel(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented /** Viewer name */ @@ -182,8 +155,7 @@ private: OutputImagePointerType m_RasterizedExtract; bool m_HasExtract; RegionType m_ExtractRegion; - RegionType m_SubsampledExtractRegion; - + /** Rendered scaled extract */ OutputImagePointerType m_RasterizedScaledExtract; bool m_HasScaledExtract; @@ -201,7 +173,7 @@ private: } // end namespace otb #ifndef OTB_MANUAL_INSTANTIATION -#include "otbImageViewerModel.txx" +#include "otbImageLayerRenderingModel.txx" #endif #endif diff --git a/Code/VisuRefac/otbImageViewerModel.txx b/Code/VisuRefac/otbImageLayerRenderingModel.txx similarity index 57% rename from Code/VisuRefac/otbImageViewerModel.txx rename to Code/VisuRefac/otbImageLayerRenderingModel.txx index 40037a12db8abae25ecdec7e4bfefcec54ef1836..5088326d545c2c26ec7a62427eeeea51f082564b 100644 --- a/Code/VisuRefac/otbImageViewerModel.txx +++ b/Code/VisuRefac/otbImageLayerRenderingModel.txx @@ -15,10 +15,10 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#ifndef __otbImageViewerModel_txx -#define __otbImageViewerModel_txx +#ifndef __otbImageLayerRenderingModel_txx +#define __otbImageLayerRenderingModel_txx -#include "otbImageViewerModel.h" +#include "otbImageLayerRenderingModel.h" #include "otbMacro.h" #include "itkTimeProbe.h" @@ -26,11 +26,12 @@ namespace otb { template <class TOutputImage> -ImageViewerModel<TOutputImage> -::ImageViewerModel() : m_Name("Default"), m_RasterizedQuicklook(), +ImageLayerRenderingModel<TOutputImage> +::ImageLayerRenderingModel() : m_Name("Default"), m_RasterizedQuicklook(), m_HasQuicklook(false),m_RasterizedExtract(),m_HasExtract(false), - m_ExtractRegion(), m_SubsampledExtractRegion(), m_RasterizedScaledExtract(), m_HasScaledExtract(false), - m_ScaledExtractRegion(), m_QuicklookBlendingFilterList(), m_ExtractBlendingFilterList(), m_ScaledExtractBlendingFilterList() + m_ExtractRegion(), m_RasterizedScaledExtract(), m_HasScaledExtract(false), + m_ScaledExtractRegion(), m_QuicklookBlendingFilterList(), m_ExtractBlendingFilterList(), + m_ScaledExtractBlendingFilterList() { // Initalize the blending filter list @@ -40,96 +41,13 @@ ImageViewerModel<TOutputImage> } template <class TOutputImage> -ImageViewerModel<TOutputImage> -::~ImageViewerModel() -{ - -} - -template <class TOutputImage> -unsigned int -ImageViewerModel<TOutputImage> -::AddLayer(LayerType * layer) -{ - // Call superclass implementation - Superclass::AddLayer(layer); - - // Add new blending filters - m_QuicklookBlendingFilterList->PushBack(BlendingFilterType::New()); - m_ExtractBlendingFilterList->PushBack(BlendingFilterType::New()); - m_ScaledExtractBlendingFilterList->PushBack(BlendingFilterType::New()); - - return (Superclass::GetNumberOfLayers()-1); -} - -template <class TOutputImage> -bool -ImageViewerModel<TOutputImage> -::DeleteLayer(unsigned int index) -{ -// Check if not out of bound and delete the ith element - if(!Superclass::DeleteLayer(index)) - { - return false; - } - else - { - m_QuicklookBlendingFilterList->Erase(index); - m_ExtractBlendingFilterList->Erase(index); - m_ScaledExtractBlendingFilterList->Erase(index); - return true; - } -} - -template <class TOutputImage> -bool -ImageViewerModel<TOutputImage> -::DeleteLayerByName(std::string name) -{ - bool layerFound = Superclass::DeleteLayerByName(name); - - if(layerFound) - { - - LayerIteratorType it = this->GetLayers()->Begin(); - bool found = false; - unsigned int index = 0; - - // Look for the layer named after name - while(it!=this->GetLayers()->End() && !found) - { - if(it.Get()->GetName() == name) - { - found = true; - } - ++index; - } - - if(found) - { - m_QuicklookBlendingFilterList->Erase(index-1); - m_ExtractBlendingFilterList->Erase(index-1); - m_ScaledExtractBlendingFilterList->Erase(index-1); - } - } - return layerFound; -} - -template <class TOutputImage> -void -ImageViewerModel<TOutputImage> -::ClearLayers() -{ - // Clear layers list - Superclass::ClearLayers(); - m_QuicklookBlendingFilterList->Clear(); - m_ExtractBlendingFilterList->Clear(); - m_ScaledExtractBlendingFilterList->Clear(); -} +ImageLayerRenderingModel<TOutputImage> +::~ImageLayerRenderingModel() +{} template <class TOutputImage> void -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::Update() { // Multiple concurrent update guards @@ -148,7 +66,7 @@ ImageViewerModel<TOutputImage> template <class TOutputImage> void -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::RenderVisibleLayers() { // Render all visible layers @@ -165,7 +83,7 @@ ImageViewerModel<TOutputImage> m_ScaledExtractRegion = this->ConstrainRegion(m_ScaledExtractRegion,m_ExtractRegion); it.Get()->SetScaledExtractRegion(m_ScaledExtractRegion); // Render it - otbMsgDevMacro(<<"ImageViewerModel::RenderVisibleLayers(): Rendering layer "<<it.Get()->GetName()<<" with regions ("<<m_ExtractRegion.GetIndex()<<" "<<m_ExtractRegion.GetSize()<<") ("<<m_ScaledExtractRegion.GetIndex()<<" "<<m_ScaledExtractRegion.GetSize()<<")"); + otbMsgDevMacro(<<"ImageLayerRenderingModel::RenderVisibleLayers(): Rendering layer "<<it.Get()->GetName()<<" with regions ("<<m_ExtractRegion.GetIndex()<<" "<<m_ExtractRegion.GetSize()<<") ("<<m_ScaledExtractRegion.GetIndex()<<" "<<m_ScaledExtractRegion.GetSize()<<")"); it.Get()->Render(); } } @@ -173,7 +91,7 @@ ImageViewerModel<TOutputImage> template <class TOutputImage> void -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::RasterizeVisibleLayers() { // If there are no layer to render @@ -190,23 +108,12 @@ ImageViewerModel<TOutputImage> // Get the lowest layer LayerIteratorType it = this->GetLayers()->Begin(); - BlendingFilterIteratorType qlBlenderIt = m_QuicklookBlendingFilterList->Begin(); - BlendingFilterIteratorType extBlenderIt = m_ExtractBlendingFilterList->Begin(); - BlendingFilterIteratorType scalBlenderIt = m_ScaledExtractBlendingFilterList->Begin(); - - bool visible = false; - while(!visible && it != this->GetLayers()->End() - && qlBlenderIt != m_QuicklookBlendingFilterList->End() - && extBlenderIt != m_ExtractBlendingFilterList->End() - && scalBlenderIt != m_ScaledExtractBlendingFilterList->End()) + while(!visible && it != this->GetLayers()->End()) { visible = it.Get()->GetVisible(); ++it; - ++qlBlenderIt; - ++extBlenderIt; - ++scalBlenderIt; } if(!visible) @@ -215,31 +122,17 @@ ImageViewerModel<TOutputImage> return; } --it; - --qlBlenderIt; - --extBlenderIt; - --scalBlenderIt; // base layer typename LayerType::Pointer baseLayer = it.Get(); - otbMsgDevMacro(<<"ImageViewerModel::RasterizeVisibleLayers(): Found base layer named "<<it.Get()->GetName()); + otbMsgDevMacro(<<"ImageLayerRenderingModel::RasterizeVisibleLayers(): Found base layer named "<<it.Get()->GetName()); // Configure base layer rasterization if(baseLayer->GetHasQuicklook()) { m_HasQuicklook = true; m_RasterizedQuicklook = baseLayer->GetRenderedQuicklook(); - - // Update the subsampled extract region - m_SubsampledExtractRegion = m_ExtractRegion; - typename RegionType::SizeType size = m_SubsampledExtractRegion.GetSize(); - typename RegionType::IndexType index = m_SubsampledExtractRegion.GetIndex(); - size[0]/=baseLayer->GetQuicklookSubsamplingRate(); - size[1]/=baseLayer->GetQuicklookSubsamplingRate(); - index[0]/=baseLayer->GetQuicklookSubsamplingRate(); - index[1]/=baseLayer->GetQuicklookSubsamplingRate(); - m_SubsampledExtractRegion.SetIndex(index); - m_SubsampledExtractRegion.SetSize(size); } if(baseLayer->GetHasExtract()) @@ -256,16 +149,25 @@ ImageViewerModel<TOutputImage> // Move to the next layer ++it; - ++qlBlenderIt; - ++extBlenderIt; - ++scalBlenderIt; - + // Walk the remaining layers - while(it!=this->GetLayers()->End() - && qlBlenderIt != m_QuicklookBlendingFilterList->End() - && extBlenderIt != m_ExtractBlendingFilterList->End() - && scalBlenderIt != m_ScaledExtractBlendingFilterList->End()) + unsigned int count = 0; + while(it!=this->GetLayers()->End()) { + // Populate Blending filter list if needed + if(count >= m_QuicklookBlendingFilterList->Size()) + { + m_QuicklookBlendingFilterList->PushBack(BlendingFilterType::New()); + } + if(count >= m_ExtractBlendingFilterList->Size()) + { + m_ExtractBlendingFilterList->PushBack(BlendingFilterType::New()); + } + if(count >= m_ScaledExtractBlendingFilterList->Size()) + { + m_ScaledExtractBlendingFilterList->PushBack(BlendingFilterType::New()); + } + // If a layer is visible if(it.Get()->GetVisible()) { @@ -275,7 +177,7 @@ ImageViewerModel<TOutputImage> if(m_HasQuicklook && it.Get()->GetHasQuicklook()) { // Blend it with the current rasterized quicklook - typename BlendingFilterType::Pointer blender =/** BlendingFilterType::New();*/qlBlenderIt.Get(); + typename BlendingFilterType::Pointer blender = m_QuicklookBlendingFilterList->GetNthElement(count); // Using the blending function of the layer blender->SetBlendingFunction(it.Get()->GetBlendingFunction()); blender->SetInput1(m_RasterizedQuicklook); @@ -289,7 +191,7 @@ ImageViewerModel<TOutputImage> if(m_HasExtract && it.Get()->GetHasExtract()) { // Blend it with the current rasterized extract - typename BlendingFilterType::Pointer blender =/** BlendingFilterType::New();*/extBlenderIt.Get(); + typename BlendingFilterType::Pointer blender = m_ExtractBlendingFilterList->GetNthElement(count); // Using the blending function of the layer blender->SetBlendingFunction(it.Get()->GetBlendingFunction()); blender->SetInput1(m_RasterizedExtract); @@ -304,7 +206,7 @@ ImageViewerModel<TOutputImage> if(m_HasScaledExtract && it.Get()->GetHasScaledExtract()) { // Blend it with the current rasterized scaledExtract - typename BlendingFilterType::Pointer blender = /**BlendingFilterType::New();*/ scalBlenderIt.Get(); + typename BlendingFilterType::Pointer blender = m_ScaledExtractBlendingFilterList->GetNthElement(count); // Using the blending function of the layer blender->SetBlendingFunction(it.Get()->GetBlendingFunction()); blender->SetInput1(m_RasterizedScaledExtract); @@ -315,30 +217,28 @@ ImageViewerModel<TOutputImage> m_RasterizedScaledExtract = blender->GetOutput(); } probe.Stop(); - otbMsgDevMacro("ImageViewerModel::RasterizeVisibleLayers(): Previous layer rasterized with layer "<<it.Get()->GetName()<<" ( "<<probe.GetMeanTime()<<" s.)"); + otbMsgDevMacro("ImageLayerRenderingModel::RasterizeVisibleLayers(): Previous layer rasterized with layer "<<it.Get()->GetName()<<" ( "<<probe.GetMeanTime()<<" s.)"); } ++it; - ++qlBlenderIt; - ++extBlenderIt; - ++scalBlenderIt; + ++count; } } template <class TOutputImage> void -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::Notify(ListenerType * listener) { // Notify the listener - otbMsgDevMacro(<<"ImageViewerModel::Notify(): Notifying listener"); - listener->ImageViewerNotify(); + otbMsgDevMacro(<<"ImageLayerRenderingModel::Notify(): Notifying listener"); + listener->ImageLayerRenderingModelNotify(); } template <class TOutputImage> void -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::SetScaledExtractRegionCenter(const IndexType & index) { // Set the center of the scaled extract region @@ -350,7 +250,7 @@ ImageViewerModel<TOutputImage> template <class TOutputImage> void -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::SetExtractRegionCenter(const IndexType & index) { // Set the center of the extract region @@ -366,32 +266,25 @@ ImageViewerModel<TOutputImage> } template <class TOutputImage> -void -ImageViewerModel<TOutputImage> -::SetExtractRegionSubsampledCenter(const IndexType & index) +unsigned int +ImageLayerRenderingModel<TOutputImage> +::GetSubsamplingRate() { -// Get the lowest layer + if(this->GetNumberOfLayers() < 1) + { + return 1; + } + // Get the lowest layer LayerIteratorType it = this->GetLayers()->Begin(); // Base layer typename LayerType::Pointer baseLayer = it.Get(); - // Set compute the upsampled center of the extract region - IndexType newIndex = index; - newIndex[0]*= baseLayer->GetQuicklookSubsamplingRate(); - newIndex[1]*= baseLayer->GetQuicklookSubsamplingRate(); - - // Update Scaled extract center as well - this->SetScaledExtractRegionCenter(newIndex); - - // Update extract region - newIndex[0]-=m_ExtractRegion.GetSize()[0]/2; - newIndex[1]-=m_ExtractRegion.GetSize()[1]/2; - m_ExtractRegion.SetIndex(newIndex); + return baseLayer->GetQuicklookSubsamplingRate(); } template <class TOutputImage> -typename ImageViewerModel<TOutputImage> +typename ImageLayerRenderingModel<TOutputImage> ::RegionType -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::ConstrainRegion(const RegionType & small, const RegionType & big) { RegionType resp = small; @@ -429,7 +322,7 @@ ImageViewerModel<TOutputImage> template <class TOutputImage> void -ImageViewerModel<TOutputImage> +ImageLayerRenderingModel<TOutputImage> ::PrintSelf(std::ostream& os, itk::Indent indent) const { // Call superclass implementation diff --git a/Code/VisuRefac/otbImageViewerModelListener.h b/Code/VisuRefac/otbImageLayerRenderingModelListener.h similarity index 65% rename from Code/VisuRefac/otbImageViewerModelListener.h rename to Code/VisuRefac/otbImageLayerRenderingModelListener.h index 361a80d8bd1b198299fa332ba6a8427d8ab36190..fdcbeeefec93d8825ed51f729718870cd65de476 100644 --- a/Code/VisuRefac/otbImageViewerModelListener.h +++ b/Code/VisuRefac/otbImageLayerRenderingModelListener.h @@ -15,35 +15,35 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#ifndef __otbImageViewerModelListener_h -#define __otbImageViewerModelListener_h +#ifndef __otbImageLayerRenderingModelListener_h +#define __otbImageLayerRenderingModelListener_h namespace otb { /** - * \class ImageViewerModelListener + * \class ImageLayerRenderingModelListener * * Vectorization view interface specification for the model * */ -class ImageViewerModelListener +class ImageLayerRenderingModelListener { public: /** Standard class typedefs */ - typedef ImageViewerModelListener Self; + typedef ImageLayerRenderingModelListener Self; // Update the display - virtual void ImageViewerNotify() = 0; + virtual void ImageLayerRenderingModelNotify() = 0; protected: /** Constructor */ - ImageViewerModelListener() {}; + ImageLayerRenderingModelListener() {}; /** Destructor */ - virtual ~ImageViewerModelListener() {}; + virtual ~ImageLayerRenderingModelListener() {}; private: - ImageViewerModelListener(const Self&); //purposely not implemented + ImageLayerRenderingModelListener(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; diff --git a/Code/VisuRefac/otbImageView.h b/Code/VisuRefac/otbImageView.h index 41186a84b72cec68f00c355ce7c7e4f92dacb159..2149c9b0f84f85c243b4f59d47b4c91c980d33c7 100644 --- a/Code/VisuRefac/otbImageView.h +++ b/Code/VisuRefac/otbImageView.h @@ -19,8 +19,7 @@ #define __otbImageView_h #include "otbImageWidget.h" -#include "otbImageViewerModelListener.h" -#include "otbImageViewerModel.h" +#include "otbImageLayerRenderingModelListener.h" #include "otbImageWidgetController.h" namespace otb @@ -33,7 +32,7 @@ namespace otb template <class TViewerModel > class ImageView - : public ImageViewerModelListener, public itk::Object + : public ImageLayerRenderingModelListener, public itk::Object { public: /** Standard class typedefs */ @@ -107,7 +106,7 @@ public: void UpdateZoomWidget(); /** Handle notification from the viewer */ - virtual void ImageViewerNotify(); + virtual void ImageLayerRenderingModelNotify(); private: ImageView(const Self&); // purposely not implemented diff --git a/Code/VisuRefac/otbImageView.txx b/Code/VisuRefac/otbImageView.txx index 1677c5102a289a664b4702607b5a59d64153f956..cd0352d35dd7dc4c8ad5e5ab13a89ef6445911b7 100644 --- a/Code/VisuRefac/otbImageView.txx +++ b/Code/VisuRefac/otbImageView.txx @@ -85,7 +85,7 @@ ImageView<TInputImage> template < class TInputImage > void ImageView<TInputImage> -::ImageViewerNotify() +::ImageLayerRenderingModelNotify() { this->Update(); } @@ -120,6 +120,7 @@ ImageView<TInputImage> const double hratio = static_cast<double>(m_ScrollWidget->h())/static_cast<double>(qlRegion.GetSize()[1]); const double scale = std::min(wratio,hratio); m_ScrollWidget->SetIsotropicZoom(scale); + m_ScrollWidget->SetSubsamplingRate(m_Model->GetSubsamplingRate()); // Setting widget label std::string label = m_ScrollWidget->GetIdentifier(); @@ -131,7 +132,7 @@ ImageView<TInputImage> if(m_Model->GetHasExtract()) { m_ScrollWidget->SetDisplayRectangle(true); - m_ScrollWidget->SetRectangle(m_Model->GetSubsampledExtractRegion()); + m_ScrollWidget->SetRectangle(m_Model->GetExtractRegion()); } else { diff --git a/Code/VisuRefac/otbImageWidget.h b/Code/VisuRefac/otbImageWidget.h index 931b690fc5337f1a6b31cd01bbafb993a4bbee10..952bf3b59fac466531150fc7d52f720df1c539f1 100644 --- a/Code/VisuRefac/otbImageWidget.h +++ b/Code/VisuRefac/otbImageWidget.h @@ -123,12 +123,24 @@ public: itkSetMacro(RectangleColor,ColorType); itkGetConstReferenceMacro(RectangleColor,ColorType); + /** Set/Get the subsampling rate */ + itkSetMacro(SubsamplingRate,unsigned int); + itkGetMacro(SubsamplingRate,unsigned int); + /** Convert a screen index to a buffered region index */ IndexType ScreenIndexToRegionIndex(const IndexType& index ); /** Convert a buffered region index to a screen index */ IndexType RegionIndexToScreenIndex(const IndexType& index); + /** Convert a screen index to an image index (taking into account + * subsampling rate) */ + IndexType ScreenIndexToImageIndex(const IndexType& index ); + + /** Convert an image index to a screen index (taking into account + * subsamplinh rate) */ + IndexType ImageIndexToScreenIndex(const IndexType& index); + protected: /** Constructor */ ImageWidget(); @@ -199,6 +211,11 @@ private: double m_ImageExtentX; double m_ImageExtentY; + /** If the image is subsampled with respect to the original image, + * this indicates the subsampling rate */ + unsigned int m_SubsamplingRate; + + }; // end class } // end namespace otb diff --git a/Code/VisuRefac/otbImageWidget.txx b/Code/VisuRefac/otbImageWidget.txx index 71f605a92e0ded99e6fc47832bb8811bf76e583d..01015eef8b25ac2118311ae559a77500077fa26c 100644 --- a/Code/VisuRefac/otbImageWidget.txx +++ b/Code/VisuRefac/otbImageWidget.txx @@ -27,7 +27,8 @@ template <class TInputImage> ImageWidget<TInputImage> ::ImageWidget() : Fl_Gl_Window(0,0,0,0), m_IsotropicZoom(1.0), m_OpenGlBuffer(NULL), m_OpenGlBufferedRegion(), m_Identifier("Default"), m_UseGlAcceleration(false), m_Rectangle(),m_DisplayRectangle(false), - m_RectangleColor(), m_ImageExtentWidth(0), m_ImageExtentHeight(0), m_ImageExtentX(), m_ImageExtentY() + m_RectangleColor(), m_ImageExtentWidth(0), m_ImageExtentHeight(0), m_ImageExtentX(), m_ImageExtentY(), + m_SubsamplingRate(1) { #ifdef OTB_GL_USE_ACCEL m_UseGlAcceleration = true; @@ -235,10 +236,10 @@ ImageWidget<TInputImage> // UL left in image space is LR in opengl space, so we need to get // the real upper left index[1]+=m_Rectangle.GetSize()[1]; - index = RegionIndexToScreenIndex(index); + index = ImageIndexToScreenIndex(index); - size[0]= static_cast<unsigned int>(static_cast<double>(m_Rectangle.GetSize()[0])*m_IsotropicZoom); - size[1] = static_cast<unsigned int>(static_cast<double>(m_Rectangle.GetSize()[1])*m_IsotropicZoom); + size[0]= static_cast<unsigned int>(static_cast<double>(m_Rectangle.GetSize()[0]/m_SubsamplingRate)*m_IsotropicZoom); + size[1] = static_cast<unsigned int>(static_cast<double>(m_Rectangle.GetSize()[1]/m_SubsamplingRate)*m_IsotropicZoom); glEnable(GL_BLEND); @@ -315,6 +316,18 @@ ImageWidget<TInputImage> return resp; } +template <class TInputImage> +typename ImageWidget<TInputImage> +::IndexType +ImageWidget<TInputImage> +::ScreenIndexToImageIndex(const IndexType & index) +{ + IndexType resp = ScreenIndexToRegionIndex(index); + resp[0]*=m_SubsamplingRate; + resp[1]*=m_SubsamplingRate; + return resp; +} + template <class TInputImage> typename ImageWidget<TInputImage> ::IndexType @@ -327,5 +340,17 @@ ImageWidget<TInputImage> return resp; } +template <class TInputImage> +typename ImageWidget<TInputImage> +::IndexType +ImageWidget<TInputImage> +::ImageIndexToScreenIndex(const IndexType & index) +{ + IndexType resp; + resp[0]=static_cast<int>(m_ImageExtentX+(index[0]/m_SubsamplingRate-m_OpenGlBufferedRegion.GetIndex()[0])*m_IsotropicZoom); + resp[1]=static_cast<int>(m_ImageExtentY+m_ImageExtentHeight-(index[1]/m_SubsamplingRate-m_OpenGlBufferedRegion.GetIndex()[1])*m_IsotropicZoom); + return resp; +} + } #endif diff --git a/Code/VisuRefac/otbLayerBasedModel.h b/Code/VisuRefac/otbLayerBasedModel.h index d613d15ebffb75f4cea4eea0a33e0cd838d111e0..cef48ddd41c30fb9dc9e048c979c00af8204f5b3 100644 --- a/Code/VisuRefac/otbLayerBasedModel.h +++ b/Code/VisuRefac/otbLayerBasedModel.h @@ -95,6 +95,11 @@ public: /** \return The number of layers */ virtual unsigned int GetNumberOfLayers(void); + /** Set/Get the layers stack */ + itkSetObjectMacro(Layers,LayerListType); + itkGetObjectMacro(Layers,LayerListType); + + protected: /** Constructor */ LayerBasedModel(); diff --git a/Code/VisuRefac/otbMVCModel.h b/Code/VisuRefac/otbMVCModelBase.h similarity index 93% rename from Code/VisuRefac/otbMVCModel.h rename to Code/VisuRefac/otbMVCModelBase.h index 1c660575827784fb040765a1aebc3d9d6cedb283..c4a699398f40eaca7a57fe1d0a83c69fef983aeb 100644 --- a/Code/VisuRefac/otbMVCModel.h +++ b/Code/VisuRefac/otbMVCModelBase.h @@ -15,21 +15,21 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#ifndef __otbMVCModel_h -#define __otbMVCModel_h +#ifndef __otbMVCModelBase_h +#define __otbMVCModelBase_h #include <set> namespace otb { -/** \class MVCModel +/** \class MVCModelBase * * Interface class for MVC based modelling. Implements the registration and * Unregistration of listeners, as well as the NotifyAll method. A valid listener must * implement a Notify() method. */ template <class TListener> -class MVCModel +class MVCModelBase { public: // Define the listener type @@ -71,9 +71,9 @@ public: protected: /** Constructor */ - MVCModel() {} + MVCModelBase() {} /** Destructor */ - ~MVCModel() {} + ~MVCModelBase() {} private: /** Registered liteners */ diff --git a/Code/VisuRefac/otbPixelDescriptionActionHandler.h b/Code/VisuRefac/otbPixelDescriptionActionHandler.h new file mode 100644 index 0000000000000000000000000000000000000000..527b153b4400ef969600ef39d847522fd4e20075 --- /dev/null +++ b/Code/VisuRefac/otbPixelDescriptionActionHandler.h @@ -0,0 +1,155 @@ +/*========================================================================= + + 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 __otbPixelDescriptionActionHandler_h +#define __otbPixelDescriptionActionHandler_h + +#include "otbImageWidgetActionHandler.h" + +namespace otb +{ +/** \class PixelDescriptionActionHandler +* \brief Implements pixel reporting capabilities. +* +* \sa ImageWidgetController +* \sa ImageWidgetActionHandler +*/ + +template <class TModel, class TView> +class PixelDescriptionActionHandler + : public ImageWidgetActionHandler +{ +public: + /** Standard class typedefs */ + typedef PixelDescriptionActionHandler Self; + typedef ImageWidgetActionHandler Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Method for creation through the object factory */ + itkNewMacro(Self); + + /** Runtime information */ + itkTypeMacro(PixelDescriptionActionHandler,ImageWidgetActionHandler); + + /** Model typedefs */ + typedef TModel ModelType; + typedef typename ModelType::Pointer ModelPointerType; + typedef typename ModelType::IndexType IndexType; + + /** View typedef */ + typedef TView ViewType; + typedef typename ViewType::Pointer ViewPointerType; + typedef typename ViewType::ImageWidgetPointerType WidgetPointerType; + + /** Handle widget event + */ + virtual bool HandleWidgetEvent(std::string widgetId, int event) + { + if(m_Model.IsNotNull() && m_View.IsNotNull()) + { + // Find the source widget + WidgetPointerType sourceWidget; + bool handle = false; + if(widgetId == m_View->GetScrollWidget()->GetIdentifier() ) + { + sourceWidget = m_View->GetScrollWidget(); + handle = true; + } + else if(widgetId == m_View->GetFullWidget()->GetIdentifier() ) + { + sourceWidget = m_View->GetFullWidget(); + handle = true; + } + else if(widgetId == m_View->GetZoomWidget()->GetIdentifier() ) + { + sourceWidget = m_View->GetZoomWidget(); + handle = true; + } + if(handle) + { + switch(event) + { + case FL_ENTER: + { + return true; + break; + } + case FL_LEAVE: + { + return true; + break; + } + case FL_MOVE: + { + // Get the hovered index + IndexType index; + index[0]=Fl::event_x(); + index[1]=Fl::event_y(); + // Convert to image index + index = sourceWidget->ScreenIndexToImageIndex(index); + // Communicate new index to model + m_Model->UpdatePixelDescription(index); + return true; + break; + } + default: + { + break; + } + } + } + } + return false; + } + + /** Set/Get the pointer to the model */ + itkSetObjectMacro(Model,ModelType); + itkGetObjectMacro(Model,ModelType); + + /** Set/Get the pointer to the view */ + itkSetObjectMacro(View,ViewType); + itkGetObjectMacro(View,ViewType); + +protected: + /** Constructor */ + PixelDescriptionActionHandler() : m_View(), m_Model() + {} + + /** Destructor */ + virtual ~PixelDescriptionActionHandler(){} + /** Printself method */ + void PrintSelf(std::ostream& os, itk::Indent indent) const + { + Superclass::PrintSelf(os,indent); + } + +private: + PixelDescriptionActionHandler(const Self&); // purposely not implemented + void operator=(const Self&); // purposely not implemented + + // Pointer to the view + ViewPointerType m_View; + + // Pointer to the model + ModelPointerType m_Model; + +}; // end class +} // end namespace otb +#endif + + diff --git a/Code/VisuRefac/otbPixelDescriptionModel.h b/Code/VisuRefac/otbPixelDescriptionModel.h index a0f6b95733d9e06c20d6d3edd95271f34cc9fee9..9412109a3968350770982f24312fdabc7dd9bcd4 100644 --- a/Code/VisuRefac/otbPixelDescriptionModel.h +++ b/Code/VisuRefac/otbPixelDescriptionModel.h @@ -18,9 +18,10 @@ #ifndef __otbPixelDescriptionModel_h #define __otbPixelDescriptionModel_h -#include "otbMVCModel.h" +#include "otbMVCModelBase.h" #include "otbLayerBasedModel.h" #include "otbPixelDescriptionModelListener.h" +#include "otbImageLayerBase.h" namespace otb { @@ -31,16 +32,16 @@ namespace otb * */ -template <class TLayer > +template <class TOutputImage > class PixelDescriptionModel - : public MVCModel<PixelDescriptionModelListener>, public LayerBasedModel< TLayer > + : public MVCModelBase<PixelDescriptionModelListener>, public LayerBasedModel< ImageLayerBase< TOutputImage > > { public: /** Standard class typedefs */ - typedef PixelDescriptionModel Self; - typedef LayerBasedModel< TLayer > Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; + typedef PixelDescriptionModel Self; + typedef LayerBasedModel< ImageLayerBase<TOutputImage > > Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; /** Runtime information */ itkTypeMacro(PixelDescriptionModel,LayerBasedModel); diff --git a/Code/VisuRefac/otbPixelDescriptionModel.txx b/Code/VisuRefac/otbPixelDescriptionModel.txx index 29edc8abbd607ca4b6d973f4e4db2fa7f4100be0..ac20aecec746c8050d428582fc897fd288bca124 100644 --- a/Code/VisuRefac/otbPixelDescriptionModel.txx +++ b/Code/VisuRefac/otbPixelDescriptionModel.txx @@ -25,27 +25,27 @@ namespace otb { -template <class TLayer> -PixelDescriptionModel<TLayer> +template <class TOutputImage> +PixelDescriptionModel<TOutputImage> ::PixelDescriptionModel() : m_PixelDescription("") { } -template <class TLayer> -PixelDescriptionModel<TLayer> +template <class TOutputImage> +PixelDescriptionModel<TOutputImage> ::~PixelDescriptionModel() {} -template <class TLayer> +template <class TOutputImage> void -PixelDescriptionModel<TLayer> +PixelDescriptionModel<TOutputImage> ::ClearPixelDescription() { m_PixelDescription = ""; } -template <class TLayer> +template <class TOutputImage> void -PixelDescriptionModel<TLayer> +PixelDescriptionModel<TOutputImage> ::UpdatePixelDescription(const IndexType & index) { // The output stringstream @@ -68,17 +68,17 @@ PixelDescriptionModel<TLayer> this->NotifyAll(); } -template <class TLayer> +template <class TOutputImage> void -PixelDescriptionModel<TLayer> +PixelDescriptionModel<TOutputImage> ::PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os,indent); } -template <class TLayer> +template <class TOutputImage> void -PixelDescriptionModel<TLayer> +PixelDescriptionModel<TOutputImage> ::Notify(ListenerType * listener) { listener->PixelDescriptionModelNotify(); diff --git a/Code/VisuRefac/otbPixelDescriptionView.h b/Code/VisuRefac/otbPixelDescriptionView.h new file mode 100644 index 0000000000000000000000000000000000000000..01fd9186fbcdf775c140c970cb162a311e13b0dc --- /dev/null +++ b/Code/VisuRefac/otbPixelDescriptionView.h @@ -0,0 +1,104 @@ +/*========================================================================= + + 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 __otbPixelDescription_h +#define __otbPixelDescription_h + +#include "otbImageWidget.h" +#include "otbImageLayerRenderingModelListener.h" +#include "otbImageWidgetController.h" + +#include <FL/Fl_Multiline_Output.H> + +namespace otb +{ + +/** \class PixelDescriptionView +* \brief +* \Todo: Rename PixelDescriptioner when refactoring will be completed. +*/ + +template <class TModel > +class PixelDescriptionView + : public PixelDescriptionModelListener, public itk::Object +{ +public: + /** Standard class typedefs */ + typedef PixelDescriptionView Self; + typedef itk::Object Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Method for creation through the object factory */ + itkNewMacro(Self); + + /** Runtime information */ + itkTypeMacro(PixelDescriptionView,itk::Object); + + /** Model typedef */ + typedef TModel ModelType; + typedef typename ModelType::Pointer ModelPointerType; + + /** Pixel description widget typedef */ + typedef Fl_Multiline_Output PixelDescriptionWidgetType; + + /** + * This method unregister with previous model if any, and + * register with the new one. + */ + void SetModel(ModelType * model); + + /** + * Manually trigger a refresh + */ + void Update(); + + /** Get the pixel description widget */ + PixelDescriptionWidgetType * GetPixelDescriptionWidget() + { + return m_PixelDescriptionWidget; + } + + protected: + /** Constructor */ + PixelDescriptionView(); + /** Destructor */ + ~PixelDescriptionView(); + + /** Handle notification from the viewer */ + virtual void PixelDescriptionModelNotify(); + +private: + PixelDescriptionView(const Self&); // purposely not implemented + void operator=(const Self&); // purposely not implemented + + /** The description widget */ + Fl_Multiline_Output * m_PixelDescriptionWidget; + + /** Model pointer */ + ModelPointerType m_Model; + +}; // end class +} // end namespace otb + +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbPixelDescriptionView.txx" +#endif + +#endif + + diff --git a/Code/VisuRefac/otbPixelDescriptionView.txx b/Code/VisuRefac/otbPixelDescriptionView.txx new file mode 100644 index 0000000000000000000000000000000000000000..b7ff95286ec4124c86dda2a4f5fa1cb4adf1cbfd --- /dev/null +++ b/Code/VisuRefac/otbPixelDescriptionView.txx @@ -0,0 +1,78 @@ +/*========================================================================= + +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 __otbPixelDescriptionView_txx +#define __otbPixelDescriptionView_txx + +#include "otbPixelDescriptionView.h" + +namespace otb +{ +template < class TInputPixelDescription > +PixelDescriptionView<TInputPixelDescription> +::PixelDescriptionView() : m_PixelDescriptionWidget(NULL), m_Model() +{ + // build a widget with a default size + m_PixelDescriptionWidget = new Fl_Multiline_Output(0,0,200,40); +} + +template < class TInputPixelDescription > +PixelDescriptionView<TInputPixelDescription> +::~PixelDescriptionView() +{ + if(m_PixelDescriptionWidget != NULL) + { + delete m_PixelDescriptionWidget; + } +} + +template < class TInputPixelDescription > +void +PixelDescriptionView<TInputPixelDescription> +::SetModel(ModelType * model) +{ + // Unregister from previous model if nay + if(m_Model.IsNotNull()) + { + m_Model->UnRegisterListener(this); + } + + // Set and register with new model + m_Model = model; + m_Model->RegisterListener(this); +} + + + +template < class TInputPixelDescription > +void +PixelDescriptionView<TInputPixelDescription> +::PixelDescriptionModelNotify() +{ + this->Update(); +} + +template < class TInputPixelDescription > +void +PixelDescriptionView<TInputPixelDescription> +::Update() +{ + m_PixelDescriptionWidget->value(m_Model->GetPixelDescription()); + m_PixelDescriptionWidget->redraw(); +} +} +#endif diff --git a/Testing/Code/VisuRefac/CMakeLists.txt b/Testing/Code/VisuRefac/CMakeLists.txt index 6fb14dab773cc837b01459625c652ee3d333caf3..ef15e18ec38524676e1a0d5c5755a20efb33a4da 100644 --- a/Testing/Code/VisuRefac/CMakeLists.txt +++ b/Testing/Code/VisuRefac/CMakeLists.txt @@ -162,25 +162,25 @@ ADD_TEST(vrTuLayerBasedModelNew ${VISUREFAC_TESTS1} otbLayerBasedModelNew ) -#------------ otb::ImageViewerModel ------------ +#------------ otb::ImageLayerRenderingModel ------------ -ADD_TEST(vrTuImageViewerModelNew ${VISUREFAC_TESTS1} -otbImageViewerModelNew +ADD_TEST(vrTuImageLayerRenderingModelNew ${VISUREFAC_TESTS1} +otbImageLayerRenderingModelNew ) -ADD_TEST(vrTvImageViewerModelSingleLayer ${VISUREFAC_TESTS1} +ADD_TEST(vrTvImageLayerRenderingModelSingleLayer ${VISUREFAC_TESTS1} --compare-n-images ${TOL} 3 -${BASELINE}/vrTvImageViewerModelSingleLayerQuicklookOutput.png -${TEMP}/vrTvImageViewerModelSingleLayerQuicklookOutput.png -${BASELINE}/vrTvImageViewerModelSingleLayerExtractOutput.png -${TEMP}/vrTvImageViewerModelSingleLayerExtractOutput.png -${BASELINE}/vrTvImageViewerModelSingleLayerScaledExtractOutput.png -${TEMP}/vrTvImageViewerModelSingleLayerScaledExtractOutput.png -otbImageViewerModelSingleLayer +${BASELINE}/vrTvImageLayerRenderingModelSingleLayerQuicklookOutput.png +${TEMP}/vrTvImageLayerRenderingModelSingleLayerQuicklookOutput.png +${BASELINE}/vrTvImageLayerRenderingModelSingleLayerExtractOutput.png +${TEMP}/vrTvImageLayerRenderingModelSingleLayerExtractOutput.png +${BASELINE}/vrTvImageLayerRenderingModelSingleLayerScaledExtractOutput.png +${TEMP}/vrTvImageLayerRenderingModelSingleLayerScaledExtractOutput.png +otbImageLayerRenderingModelSingleLayer ${INPUTDATA}/couleurs.tif -${TEMP}/vrTvImageViewerModelSingleLayerQuicklookOutput.png -${TEMP}/vrTvImageViewerModelSingleLayerExtractOutput.png -${TEMP}/vrTvImageViewerModelSingleLayerScaledExtractOutput.png +${TEMP}/vrTvImageLayerRenderingModelSingleLayerQuicklookOutput.png +${TEMP}/vrTvImageLayerRenderingModelSingleLayerExtractOutput.png +${TEMP}/vrTvImageLayerRenderingModelSingleLayerScaledExtractOutput.png ) #------------ otb::ImageLayerGenerator ------------ @@ -247,8 +247,8 @@ otbUniformAlphaBlendingFunctionNew.cxx otbBlendingImageFilterNew.cxx otbBlendingImageFilter.cxx otbLayerBasedModelNew.cxx -otbImageViewerModelNew.cxx -otbImageViewerModelSingleLayer.cxx +otbImageLayerRenderingModelNew.cxx +otbImageLayerRenderingModelSingleLayer.cxx otbImageLayerGeneratorNew.cxx otbImageLayerGeneratorScalar.cxx otbImageLayerGeneratorVector.cxx diff --git a/Testing/Code/VisuRefac/otbImageViewerModelNew.cxx b/Testing/Code/VisuRefac/otbImageLayerRenderingModelNew.cxx similarity index 82% rename from Testing/Code/VisuRefac/otbImageViewerModelNew.cxx rename to Testing/Code/VisuRefac/otbImageLayerRenderingModelNew.cxx index 7caba88b6e147850f120972f37ff97269d6fd6aa..8cb359f4185c5bb0b420064a11302e98e3dab338 100644 --- a/Testing/Code/VisuRefac/otbImageViewerModelNew.cxx +++ b/Testing/Code/VisuRefac/otbImageLayerRenderingModelNew.cxx @@ -15,15 +15,15 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "otbImageViewerModel.h" +#include "otbImageLayerRenderingModel.h" #include "otbImage.h" #include "itkRGBPixel.h" -int otbImageViewerModelNew( int argc, char * argv[] ) +int otbImageLayerRenderingModelNew( int argc, char * argv[] ) { typedef itk::RGBPixel<unsigned char> RGBPixelType; typedef otb::Image<RGBPixelType,2> ImageType; - typedef otb::ImageViewerModel<ImageType> ModelType; + typedef otb::ImageLayerRenderingModel<ImageType> ModelType; // Instantiation ModelType::Pointer model = ModelType::New(); diff --git a/Testing/Code/VisuRefac/otbImageViewerModelSingleLayer.cxx b/Testing/Code/VisuRefac/otbImageLayerRenderingModelSingleLayer.cxx similarity index 94% rename from Testing/Code/VisuRefac/otbImageViewerModelSingleLayer.cxx rename to Testing/Code/VisuRefac/otbImageLayerRenderingModelSingleLayer.cxx index b2c53620b4bd822c4aacc040799c92ea57cd2c8b..293bf834da82fe17cc017b96aa9ec2772969e86a 100644 --- a/Testing/Code/VisuRefac/otbImageViewerModelSingleLayer.cxx +++ b/Testing/Code/VisuRefac/otbImageLayerRenderingModelSingleLayer.cxx @@ -15,7 +15,7 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "otbImageViewerModel.h" +#include "otbImageLayerRenderingModel.h" #include "otbVectorImage.h" #include "itkRGBPixel.h" #include "otbImageFileReader.h" @@ -24,7 +24,7 @@ PURPOSE. See the above copyright notices for more information. #include "otbImageFileWriter.h" #include "otbImageLayer.h" -int otbImageViewerModelSingleLayer( int argc, char * argv[] ) +int otbImageLayerRenderingModelSingleLayer( int argc, char * argv[] ) { // params const char * infname = argv[1]; @@ -39,7 +39,7 @@ int otbImageViewerModelSingleLayer( int argc, char * argv[] ) typedef otb::ImageLayer<ImageType> LayerType; typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::ImageLayerGenerator<LayerType> LayerGeneratorType; - typedef otb::ImageViewerModel<OutputImageType> ModelType; + typedef otb::ImageLayerRenderingModel<OutputImageType> ModelType; typedef otb::ImageFileWriter<OutputImageType> WriterType; // Instantiation diff --git a/Testing/Code/VisuRefac/otbImageViewNew.cxx b/Testing/Code/VisuRefac/otbImageViewNew.cxx index f3a0374f4eeefb9b3b3e263360f9794ad00e5971..9f5b41e254b0074a37d77cc2c775dc972fedeaee 100644 --- a/Testing/Code/VisuRefac/otbImageViewNew.cxx +++ b/Testing/Code/VisuRefac/otbImageViewNew.cxx @@ -15,7 +15,7 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "otbImageViewerModel.h" +#include "otbImageLayerRenderingModel.h" #include "otbImage.h" #include "itkRGBPixel.h" #include "otbImageView.h" @@ -24,7 +24,7 @@ int otbImageViewNew( int argc, char * argv[] ) { typedef itk::RGBPixel<unsigned char> RGBPixelType; typedef otb::Image<RGBPixelType,2> ImageType; - typedef otb::ImageViewerModel<ImageType> ModelType; + typedef otb::ImageLayerRenderingModel<ImageType> ModelType; typedef otb::ImageView<ModelType> ViewType; // Instantiation diff --git a/Testing/Code/VisuRefac/otbImageViewerEndToEndSingleLayer.cxx b/Testing/Code/VisuRefac/otbImageViewerEndToEndSingleLayer.cxx index c2b49928660e78feb1fb3ce5ebadd9c6cf0cf362..c2c7a18b6d3bf3fe846ad6ae35100552def444c9 100644 --- a/Testing/Code/VisuRefac/otbImageViewerEndToEndSingleLayer.cxx +++ b/Testing/Code/VisuRefac/otbImageViewerEndToEndSingleLayer.cxx @@ -15,7 +15,7 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "otbImageViewerModel.h" +#include "otbImageLayerRenderingModel.h" #include "otbVectorImage.h" #include "itkRGBPixel.h" #include "otbImageFileReader.h" @@ -29,7 +29,9 @@ PURPOSE. See the above copyright notices for more information. #include "otbChangeScaledExtractRegionActionHandler.h" #include "otbChangeExtractRegionActionHandler.h" #include "otbChangeScaleActionHandler.h" - +#include "otbPixelDescriptionModel.h" +#include "otbPixelDescriptionActionHandler.h" +#include "otbPixelDescriptionView.h" int otbImageViewerEndToEndSingleLayer( int argc, char * argv[] ) { @@ -49,7 +51,7 @@ int otbImageViewerEndToEndSingleLayer( int argc, char * argv[] ) typedef otb::ImageLayer<ImageType> LayerType; typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::ImageLayerGenerator<LayerType> LayerGeneratorType; - typedef otb::ImageViewerModel<OutputImageType> ModelType; + typedef otb::ImageLayerRenderingModel<OutputImageType> ModelType; typedef otb::ImageView<ModelType> ViewType; typedef otb::ImageWidgetController ControllerType; typedef otb::WidgetResizingActionHandler @@ -60,9 +62,17 @@ int otbImageViewerEndToEndSingleLayer( int argc, char * argv[] ) <ModelType,ViewType> ChangeRegionHandlerType; typedef otb::ChangeScaleActionHandler <ModelType,ViewType> ChangeScaleHandlerType; + typedef otb::PixelDescriptionModel<OutputImageType> PixelDescriptionModelType; + typedef otb::PixelDescriptionActionHandler + < PixelDescriptionModelType, ViewType> PixelDescriptionActionHandlerType; + typedef otb::PixelDescriptionView + < PixelDescriptionModelType > PixelDescriptionViewType; + // Instantiation ModelType::Pointer model = ModelType::New(); + PixelDescriptionModelType::Pointer pixelModel = PixelDescriptionModelType::New(); + pixelModel->SetLayers(model->GetLayers()); // Reading input image ReaderType::Pointer reader = ReaderType::New(); @@ -76,6 +86,7 @@ int otbImageViewerEndToEndSingleLayer( int argc, char * argv[] ) // Add the layer to the model model->AddLayer(generator->GetLayer()); + // Build a view ViewType::Pointer view = ViewType::New(); view->SetModel(model); @@ -90,7 +101,7 @@ int otbImageViewerEndToEndSingleLayer( int argc, char * argv[] ) resizingHandler->SetView(view); controller->AddActionHandler(resizingHandler); -// Add the change scaled region handler + // Add the change scaled region handler ChangeScaledRegionHandlerType::Pointer changeScaledHandler =ChangeScaledRegionHandlerType::New(); changeScaledHandler->SetModel(model); changeScaledHandler->SetView(view); @@ -102,12 +113,32 @@ int otbImageViewerEndToEndSingleLayer( int argc, char * argv[] ) changeHandler->SetView(view); controller->AddActionHandler(changeHandler); -// Add the change scaled handler + // Add the change scaled handler ChangeScaleHandlerType::Pointer changeScaleHandler =ChangeScaleHandlerType::New(); changeScaleHandler->SetModel(model); changeScaleHandler->SetView(view); controller->AddActionHandler(changeScaleHandler); + // Add the pixel description action handler + PixelDescriptionActionHandlerType::Pointer pixelActionHandler = PixelDescriptionActionHandlerType::New(); + pixelActionHandler->SetView(view); + pixelActionHandler->SetModel(pixelModel); + controller->AddActionHandler(pixelActionHandler); + + // Build a pixel description view + PixelDescriptionViewType::Pointer pixelView = PixelDescriptionViewType::New(); + pixelView->SetModel(pixelModel); + + Fl_Window pixelWindow(fullSize,50); + if(fullSize > 0) + { + pixelWindow.add(pixelView->GetPixelDescriptionWidget()); + pixelWindow.resizable(pixelView->GetPixelDescriptionWidget()); + pixelWindow.show(); + pixelView->GetPixelDescriptionWidget()->show(); + pixelView->GetPixelDescriptionWidget()->resize(0,0,fullSize,50); + } + Fl_Window scrollWindow(scrollSize,scrollSize); if(scrollSize > 0) { @@ -150,6 +181,7 @@ int otbImageViewerEndToEndSingleLayer( int argc, char * argv[] ) zoomWindow.remove(view->GetZoomWidget()); scrollWindow.remove(view->GetScrollWidget()); fullWindow.remove(view->GetFullWidget()); + pixelWindow.remove(pixelView->GetPixelDescriptionWidget()); return EXIT_SUCCESS; } diff --git a/Testing/Code/VisuRefac/otbImageViewerEndToEndTwoLayers.cxx b/Testing/Code/VisuRefac/otbImageViewerEndToEndTwoLayers.cxx index bec2115d9d1c90c23dbf8197a02d86100b1598d0..6f70b725f7194707ccf073ae13e1a47d7abe48f2 100644 --- a/Testing/Code/VisuRefac/otbImageViewerEndToEndTwoLayers.cxx +++ b/Testing/Code/VisuRefac/otbImageViewerEndToEndTwoLayers.cxx @@ -15,7 +15,7 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "otbImageViewerModel.h" +#include "otbImageLayerRenderingModel.h" #include "otbVectorImage.h" #include "itkRGBPixel.h" #include "otbImageFileReader.h" @@ -31,6 +31,9 @@ PURPOSE. See the above copyright notices for more information. #include "otbChangeScaleActionHandler.h" #include "itkSobelEdgeDetectionImageFilter.h" #include "otbPerBandVectorImageFilter.h" +#include "otbPixelDescriptionModel.h" +#include "otbPixelDescriptionActionHandler.h" +#include "otbPixelDescriptionView.h" int otbImageViewerEndToEndTwoLayers( int argc, char * argv[] ) { @@ -51,7 +54,7 @@ int otbImageViewerEndToEndTwoLayers( int argc, char * argv[] ) typedef otb::ImageLayer<ImageType> LayerType; typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::ImageLayerGenerator<LayerType> LayerGeneratorType; - typedef otb::ImageViewerModel<OutputImageType> ModelType; + typedef otb::ImageLayerRenderingModel<OutputImageType> ModelType; typedef otb::ImageView<ModelType> ViewType; typedef otb::ImageWidgetController ControllerType; typedef otb::WidgetResizingActionHandler @@ -62,15 +65,21 @@ int otbImageViewerEndToEndTwoLayers( int argc, char * argv[] ) <ModelType,ViewType> ChangeRegionHandlerType; typedef otb::ChangeScaleActionHandler <ModelType,ViewType> ChangeScaleHandlerType; + typedef otb::PixelDescriptionModel<OutputImageType> PixelDescriptionModelType; + typedef otb::PixelDescriptionActionHandler + < PixelDescriptionModelType, ViewType> PixelDescriptionActionHandlerType; + typedef otb::PixelDescriptionView + < PixelDescriptionModelType > PixelDescriptionViewType; // Filters for the second layer typedef itk::SobelEdgeDetectionImageFilter<ScalarImageType,ScalarImageType> FilterType; typedef otb::PerBandVectorImageFilter<ImageType,ImageType,FilterType> PerBandFilterType; - // Instantiation ModelType::Pointer model = ModelType::New(); + PixelDescriptionModelType::Pointer pixelModel = PixelDescriptionModelType::New(); + pixelModel->SetLayers(model->GetLayers()); // Reading input image ReaderType::Pointer reader = ReaderType::New(); @@ -109,7 +118,7 @@ int otbImageViewerEndToEndTwoLayers( int argc, char * argv[] ) resizingHandler->SetView(view); controller->AddActionHandler(resizingHandler); -// Add the change scaled region handler + // Add the change scaled region handler ChangeScaledRegionHandlerType::Pointer changeScaledHandler =ChangeScaledRegionHandlerType::New(); changeScaledHandler->SetModel(model); changeScaledHandler->SetView(view); @@ -121,13 +130,33 @@ int otbImageViewerEndToEndTwoLayers( int argc, char * argv[] ) changeHandler->SetView(view); controller->AddActionHandler(changeHandler); -// Add the change scaled handler + // Add the change scaled handler ChangeScaleHandlerType::Pointer changeScaleHandler =ChangeScaleHandlerType::New(); changeScaleHandler->SetModel(model); changeScaleHandler->SetView(view); controller->AddActionHandler(changeScaleHandler); - Fl_Window scrollWindow(scrollSize,scrollSize); + // Add the pixel description action handler + PixelDescriptionActionHandlerType::Pointer pixelActionHandler = PixelDescriptionActionHandlerType::New(); + pixelActionHandler->SetView(view); + pixelActionHandler->SetModel(pixelModel); + controller->AddActionHandler(pixelActionHandler); + + // Build a pixel description view + PixelDescriptionViewType::Pointer pixelView = PixelDescriptionViewType::New(); + pixelView->SetModel(pixelModel); + + Fl_Window pixelWindow(fullSize,50); + if(fullSize > 0) + { + pixelWindow.add(pixelView->GetPixelDescriptionWidget()); + pixelWindow.resizable(pixelView->GetPixelDescriptionWidget()); + pixelWindow.show(); + pixelView->GetPixelDescriptionWidget()->show(); + pixelView->GetPixelDescriptionWidget()->resize(0,0,fullSize,50); + } + + Fl_Window scrollWindow(scrollSize,scrollSize); if(scrollSize > 0) { scrollWindow.add(view->GetScrollWidget()); @@ -169,6 +198,7 @@ int otbImageViewerEndToEndTwoLayers( int argc, char * argv[] ) zoomWindow.remove(view->GetZoomWidget()); scrollWindow.remove(view->GetScrollWidget()); fullWindow.remove(view->GetFullWidget()); - + pixelWindow.remove(pixelView->GetPixelDescriptionWidget()); + return EXIT_SUCCESS; } diff --git a/Testing/Code/VisuRefac/otbLayerBasedModelNew.cxx b/Testing/Code/VisuRefac/otbLayerBasedModelNew.cxx index 261168e37818c47c622108df80d226de1ce73600..e642eb48e8226f464e00f1610f9144c63b82730e 100644 --- a/Testing/Code/VisuRefac/otbLayerBasedModelNew.cxx +++ b/Testing/Code/VisuRefac/otbLayerBasedModelNew.cxx @@ -15,7 +15,7 @@ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "otbLayer.h" +#include "otbImageLayerBase.h" #include "otbLayerBasedModel.h" #include "otbImage.h" #include "itkRGBPixel.h" @@ -24,7 +24,7 @@ int otbLayerBasedModelNew( int argc, char * argv[] ) { typedef itk::RGBPixel<unsigned char> RGBPixelType; typedef otb::Image<RGBPixelType,2> ImageType; - typedef otb::Layer<ImageType> LayerType; + typedef otb::ImageLayerBase<ImageType> LayerType; typedef otb::LayerBasedModel<LayerType> ModelType; // Instantiation diff --git a/Testing/Code/VisuRefac/otbPixelDescriptionModelNew.cxx b/Testing/Code/VisuRefac/otbPixelDescriptionModelNew.cxx index e2151120859398e35db1be204494a25f8ce08b28..bda26f04f8b4b94c87ec27f45be301182833a0b0 100644 --- a/Testing/Code/VisuRefac/otbPixelDescriptionModelNew.cxx +++ b/Testing/Code/VisuRefac/otbPixelDescriptionModelNew.cxx @@ -22,8 +22,7 @@ PURPOSE. See the above copyright notices for more information. int otbPixelDescriptionModelNew( int argc, char * argv[] ) { typedef otb::Image<double,2> ImageType; - typedef otb::ImageLayer<ImageType> LayerType; - typedef otb::PixelDescriptionModel<LayerType> ModelType; + typedef otb::PixelDescriptionModel<ImageType> ModelType; // Instantiation ModelType::Pointer model = ModelType::New(); diff --git a/Testing/Code/VisuRefac/otbPixelDescriptionModelSingleLayer.cxx b/Testing/Code/VisuRefac/otbPixelDescriptionModelSingleLayer.cxx index 3fa4ef9bf874e87fe6b715d0af1e432db72b0dab..75b91fd87ea5d992a15be56c24ae0054d52bbe4f 100644 --- a/Testing/Code/VisuRefac/otbPixelDescriptionModelSingleLayer.cxx +++ b/Testing/Code/VisuRefac/otbPixelDescriptionModelSingleLayer.cxx @@ -26,11 +26,11 @@ int otbPixelDescriptionModelSingleLayer( int argc, char * argv[] ) // params const char * infname = argv[1]; - typedef otb::VectorImage<double,2> ImageType; - typedef otb::ImageLayer<ImageType> LayerType; - typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::ImageLayerGenerator<LayerType> LayerGeneratorType; - typedef otb::PixelDescriptionModel<LayerType> ModelType; + typedef otb::VectorImage<double,2> ImageType; + typedef otb::ImageLayer<ImageType> LayerType; + typedef otb::ImageFileReader<ImageType> ReaderType; + typedef otb::ImageLayerGenerator<LayerType> LayerGeneratorType; + typedef otb::PixelDescriptionModel<LayerType::OutputImageType> ModelType; // Instantiation ModelType::Pointer model = ModelType::New(); diff --git a/Testing/Code/VisuRefac/otbVisuRefacTests1.cxx b/Testing/Code/VisuRefac/otbVisuRefacTests1.cxx index dffa6cf9491e65e9ab00df4c1dc57781415c32f9..60062db6f5fb90f5fdc2a6849ec3bf1a7fe99147 100644 --- a/Testing/Code/VisuRefac/otbVisuRefacTests1.cxx +++ b/Testing/Code/VisuRefac/otbVisuRefacTests1.cxx @@ -43,8 +43,8 @@ void RegisterTests() REGISTER_TEST(otbBlendingImageFilterNew); REGISTER_TEST(otbBlendingImageFilter); REGISTER_TEST(otbLayerBasedModelNew); - REGISTER_TEST(otbImageViewerModelNew); - REGISTER_TEST(otbImageViewerModelSingleLayer); + REGISTER_TEST(otbImageLayerRenderingModelNew); + REGISTER_TEST(otbImageLayerRenderingModelSingleLayer); REGISTER_TEST(otbImageLayerGeneratorNew); REGISTER_TEST(otbImageLayerGeneratorScalar); REGISTER_TEST(otbImageLayerGeneratorVector);