From 92b9025ca785db99f3d5efa637de2ac8308fad65 Mon Sep 17 00:00:00 2001
From: Thomas Feuvrier <thomas.feuvrier@c-s.fr>
Date: Thu, 12 Jun 2008 07:52:43 +0000
Subject: [PATCH] Correction : ajout static_cast<double>() pour l'apel aux
 fonction vcl_atan2 et vcl_sqrt car erreurs de compilation sous Visual 7.1

---
 Code/Visu/otbImageViewerBase.txx | 4 ++--
 Code/Visu/otbImageWidgetBase.txx | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Code/Visu/otbImageViewerBase.txx b/Code/Visu/otbImageViewerBase.txx
index 177eed0a12..5099acc6c9 100644
--- a/Code/Visu/otbImageViewerBase.txx
+++ b/Code/Visu/otbImageViewerBase.txx
@@ -119,7 +119,7 @@ namespace otb
 	  PixelType pixel = it.Get();
 	  for(unsigned int i = 0;i<m_InputImage->GetNumberOfComponentsPerPixel();++i)
 	    {
-	      sl->GetNthElement(0)->PushBack(vcl_sqrt(pixel[m_RedChannelIndex]*pixel[m_RedChannelIndex]+pixel[m_GreenChannelIndex]*pixel[m_GreenChannelIndex]));
+	      sl->GetNthElement(0)->PushBack(vcl_sqrt(static_cast<double>(pixel[m_RedChannelIndex]*pixel[m_RedChannelIndex]+pixel[m_GreenChannelIndex]*pixel[m_GreenChannelIndex])));
 	    }
 	  ++it;
 	}
@@ -132,7 +132,7 @@ namespace otb
 	  PixelType pixel = it.Get();
 	  for(unsigned int i = 0;i<m_InputImage->GetNumberOfComponentsPerPixel();++i)
 	    {
-	      sl->GetNthElement(0)->PushBack(vcl_atan2(pixel[m_RedChannelIndex],pixel[m_GreenChannelIndex]));
+	      sl->GetNthElement(0)->PushBack(vcl_atan2(static_cast<double>(pixel[m_RedChannelIndex]),static_cast<double>(pixel[m_GreenChannelIndex])));
 	    }
 	  ++it;
 	}
diff --git a/Code/Visu/otbImageWidgetBase.txx b/Code/Visu/otbImageWidgetBase.txx
index aedfaf5a41..61dcb46e9a 100644
--- a/Code/Visu/otbImageWidgetBase.txx
+++ b/Code/Visu/otbImageWidgetBase.txx
@@ -398,8 +398,8 @@ ImageWidgetBase<TPixel>
 	}
 	case COMPLEX_MODULUS:
 	{
-	  unsigned char  modulus = Normalize(static_cast<PixelType>(vcl_sqrt(it.Get()[m_RedChannelIndex]*it.Get()[m_RedChannelIndex]
-				       +it.Get()[m_GreenChannelIndex]*it.Get()[m_GreenChannelIndex])),0);
+	  unsigned char  modulus = Normalize(static_cast<PixelType>(vcl_sqrt(static_cast<double>(it.Get()[m_RedChannelIndex]*it.Get()[m_RedChannelIndex]
+				       +it.Get()[m_GreenChannelIndex]*it.Get()[m_GreenChannelIndex]))),0);
 	  m_OpenGlBuffer[index] =   modulus;
 	  m_OpenGlBuffer[index+1] = modulus;
 	  m_OpenGlBuffer[index+2] = modulus;
@@ -409,7 +409,7 @@ ImageWidgetBase<TPixel>
 	}
 	case COMPLEX_PHASE:
 	  {
-	    unsigned char phase =  Normalize(static_cast<PixelType>(vcl_atan2(it.Get()[m_RedChannelIndex],it.Get()[m_GreenChannelIndex])),0);
+	    unsigned char phase =  Normalize(static_cast<PixelType>(vcl_atan2(static_cast<double>(it.Get()[m_RedChannelIndex]),static_cast<double>(it.Get()[m_GreenChannelIndex]))),0);
 	    m_OpenGlBuffer[index]   = phase;
 	    m_OpenGlBuffer[index+1] = phase;
 	    m_OpenGlBuffer[index+2] = phase;
-- 
GitLab