From 371065c28f0a1f529549186075421398e95508bc Mon Sep 17 00:00:00 2001 From: Jonathan Guinet <jonathan.guinet@c-s.fr> Date: Wed, 18 May 2011 09:37:41 +0200 Subject: [PATCH] ENH : revert changes --- Code/Visualization/otbPixelDescriptionModel.h | 16 ------- .../otbPixelDescriptionModel.txx | 47 +------------------ .../Common/itkScalarToRGBPixelFunctor.txx | 1 + 3 files changed, 2 insertions(+), 62 deletions(-) diff --git a/Code/Visualization/otbPixelDescriptionModel.h b/Code/Visualization/otbPixelDescriptionModel.h index 02f855eb14..eae9b1816a 100644 --- a/Code/Visualization/otbPixelDescriptionModel.h +++ b/Code/Visualization/otbPixelDescriptionModel.h @@ -68,16 +68,6 @@ public: /** Update the pixel description */ void UpdatePixelDescription(const IndexType& index); - /** add layer name in pixel information description**/ - void AddLayerNameToDisplay(const char *layerName); - - /** remove layer name in pixel information description return true if the layer name have been found - * false otherwise **/ - bool RemoveLayerNameToDisplay(const char *layerName); - - - - protected: /** Constructor */ PixelDescriptionModel(); @@ -90,9 +80,6 @@ protected: /** Notify a registered listener */ void NotifyListener(ListenerType * listener); - /** check if the layer pixel description has to be displayed **/ - bool HasToDisplayLayerPixeldescription(const char *layerName); - private: PixelDescriptionModel(const Self&); // purposely not implemented void operator =(const Self&); // purposely not implemented @@ -100,9 +87,6 @@ private: /** The pixel description */ std::string m_PixelDescription; - /** which layer to display **/ - std::vector<std::string> m_LayerNameToDisplay; - }; // end class } // end namespace otb diff --git a/Code/Visualization/otbPixelDescriptionModel.txx b/Code/Visualization/otbPixelDescriptionModel.txx index 7b4e35c1c5..f666eed9a6 100644 --- a/Code/Visualization/otbPixelDescriptionModel.txx +++ b/Code/Visualization/otbPixelDescriptionModel.txx @@ -44,51 +44,6 @@ PixelDescriptionModel<TOutputImage> m_PixelDescription = ""; } -template <class TOutputImage> -void PixelDescriptionModel<TOutputImage> -::AddLayerNameToDisplay(const char* layerName) - { - std::string stringName(layerName); - m_LayerNameToDisplay.push_back(stringName); - - } - - /** **/ -template <class TOutputImage> -bool PixelDescriptionModel<TOutputImage> -::RemoveLayerNameToDisplay(const char * layerName) -{ - - for (unsigned int i = 0; i < m_LayerNameToDisplay.size(); i++) - { - if (!(m_LayerNameToDisplay.at(i).compare(layerName))) - { - std::cout << "layer found remove " << m_LayerNameToDisplay.at(i) << std::endl; - m_LayerNameToDisplay.erase(m_LayerNameToDisplay.begin()+i); - return true; - } - - } - return false; - -} - -template <class TOutputImage> -bool PixelDescriptionModel<TOutputImage> -::HasToDisplayLayerPixeldescription(const char * layerName) - { - for (unsigned int i = 0; i < m_LayerNameToDisplay.size(); i++) - { - if (!(m_LayerNameToDisplay.at(i).compare(layerName))) - return true; - - } - return false; - - } - - - template <class TOutputImage> void PixelDescriptionModel<TOutputImage> @@ -102,7 +57,7 @@ PixelDescriptionModel<TOutputImage> it != this->GetLayers()->End(); ++it) { // If the layer is visible - if (it.Get()->GetVisible() || this->HasToDisplayLayerPixeldescription(it.Get()->GetName())) + if (it.Get()->GetVisible()) { // Get the pixel description oss << it.Get()->GetPixelDescription(index) << std::endl; diff --git a/Utilities/ITK/Code/Common/itkScalarToRGBPixelFunctor.txx b/Utilities/ITK/Code/Common/itkScalarToRGBPixelFunctor.txx index 52fc9444d1..b15d1e46e0 100644 --- a/Utilities/ITK/Code/Common/itkScalarToRGBPixelFunctor.txx +++ b/Utilities/ITK/Code/Common/itkScalarToRGBPixelFunctor.txx @@ -65,6 +65,7 @@ ScalarToRGBPixelFunctor<TScalar> ans[0] = static_cast<RGBComponentType>( bytes[m_Index[0]] * 3 ); ans[1] = static_cast<RGBComponentType>( (bytes[m_Index[0]] + bytes[m_Index[1]]) * 5 ); ans[2] = static_cast<RGBComponentType>( (bytes[m_Index[0]] + bytes[m_Index[2]]) ); + return ans; } -- GitLab