BUG: remove ugly cast
authorEmmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
Wed Jul 01 13:45:22 2009 +0800 (14 months ago)
changeset 1499a63fd192d52c
parent 1498 34dce3a212c0
child 1500 2017ef421c07
BUG: remove ugly cast
ImageToDBRegistration/Model/otbImageToDBRegistrationModel.cxx
     1.1 --- a/ImageToDBRegistration/Model/otbImageToDBRegistrationModel.cxx	Wed Jul 01 13:17:33 2009 +0800
     1.2 +++ b/ImageToDBRegistration/Model/otbImageToDBRegistrationModel.cxx	Wed Jul 01 13:45:22 2009 +0800
     1.3 @@ -521,20 +521,21 @@
     1.4        /** Display the image result */
     1.5        unsigned int size = m_FocusingVisuModel->GetWorkingModel()->GetNumberOfLayers();
     1.6        if(size>1)
     1.7 -	{
     1.8 -	  for(unsigned int j=1; j<size; j++)
     1.9 -	    {
    1.10 -	      m_FocusingVisuModel->GetWorkingModel()->DeleteLayer(j);
    1.11 -	    }
    1.12 -	}
    1.13 +      {
    1.14 +        for(unsigned int j=1; j<size; j++)
    1.15 +        {
    1.16 +          m_FocusingVisuModel->GetWorkingModel()->DeleteLayer(j);
    1.17 +        }
    1.18 +      }
    1.19        LayerType * lLayer = static_cast<LayerType*>(m_FocusingVisuModel->GetWorkingModel()->GetLayer(0));
    1.20        //FIXME define a generic method SetParameter with a map for rendering function for example
    1.21        // to avoid these ugly cast...
    1.22        static_cast<Function::StandardRenderingFunction<InputImagePixelType,RGBPixelType>* >(lGenerator->GetLayer()->GetRenderingFunction())->SetAutoMinMax( false );
    1.23        lGenerator->GetLayer()->SetRenderingFunction( lLayer->GetRenderingFunction() );
    1.24  //       lGenerator->GetLayer()->SetAutoMinMax( false );
    1.25 -      BlendingFunctionType::Pointer blendfunc = lGenerator->GetLayer()->GetBlendingFunction();
    1.26 -      dynamic_cast<UniformAlphaBlendingFunctionType *>(static_cast<BlendingFunctionType *>((blendfunc)))->SetAlpha(m_Alpha);
    1.27 +      UniformAlphaBlendingFunctionType::Pointer blendfunc = UniformAlphaBlendingFunctionType::New();
    1.28 +      blendfunc->SetAlpha(m_Alpha);
    1.29 +      lGenerator->GetLayer()->SetBlendingFunction(blendfunc);
    1.30        m_FocusingVisuModel->GetWorkingModel()->AddLayer(lGenerator->GetLayer());
    1.31        m_FocusingVisuModel->GetWorkingModel()->Update();
    1.32