From 67289def30b6a8c5aa48a296fcf0e387538a548c Mon Sep 17 00:00:00 2001 From: Otmane Lahlou <otmane.lahlou@c-s.fr> Date: Thu, 20 Oct 2011 18:53:45 +0200 Subject: [PATCH] ENH: add the methods and macros relative to the ComplexInputImage param --- .../otbWrapperApplication.cxx | 6 ++--- .../ApplicationEngine/otbWrapperApplication.h | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Code/ApplicationEngine/otbWrapperApplication.cxx b/Code/ApplicationEngine/otbWrapperApplication.cxx index 48a58045ff..a24903ce74 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.cxx +++ b/Code/ApplicationEngine/otbWrapperApplication.cxx @@ -301,9 +301,9 @@ ParameterType Application::GetParameterType(std::string paramKey) const { type = ParameterType_InputImageList; } - else if (dynamic_cast<const InputComplexImageParameter*>(param)) + else if (dynamic_cast<const ComplexInputImageParameter*>(param)) { - type = ParameterType_InputComplexImage; + type = ParameterType_ComplexInputImage; } else if (dynamic_cast<const InputVectorDataParameter*>(param)) { @@ -715,7 +715,7 @@ ComplexFloatVectorImageType* Application::GetParameterComplexImage(std::string p ComplexFloatVectorImageType::Pointer ret; Parameter* param = GetParameterByKey(parameter); - if (dynamic_cast<InputComplexImageParameter*>(param)) + if (dynamic_cast<ComplexInputImageParameter*>(param)) { InputComplexImageParameter* paramDown = dynamic_cast<InputComplexImageParameter*>(param); ret = paramDown->GetImage(); diff --git a/Code/ApplicationEngine/otbWrapperApplication.h b/Code/ApplicationEngine/otbWrapperApplication.h index 9711db49d4..e934c26105 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.h +++ b/Code/ApplicationEngine/otbWrapperApplication.h @@ -30,6 +30,7 @@ #include "otbWrapperMacros.h" #include "otbWrapperOutputImageParameter.h" #include "otbWrapperInputImageParameter.h" +#include "otbWrapperComplexInputImageParameter.h" namespace otb { @@ -324,6 +325,32 @@ public: otbGetParameterImageMacro(Int32RGBAImage); otbGetParameterImageMacro(FloatRGBAImage); otbGetParameterImageMacro(DoubleRGBAImage); + + /* Get a complex image value + * + * Can be called for types : + * \li ParameterType_ComplexInputImage + */ + +#define otbGetParameterComplexImageMacro( Image ) \ + Image##Type * GetParameter##Image( std::string parameter ) \ + { \ + Image##Type::Pointer ret; \ + Parameter* param = GetParameterByKey(parameter); \ + if (dynamic_cast<ComplexInputImageParameter*>(param)) \ + { \ + ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); \ + ret = paramDown->Get##Image(); \ + } \ + return ret; \ + } + + otbGetParameterComplexImageMacro(ComplexFloatImage); + otbGetParameterComplexImageMacro(ComplexDoubleImage); + + otbGetParameterComplexImageMacro(ComplexFloatVectorImage); + otbGetParameterComplexImageMacro(ComplexDoubleVectorImage); + /* Get an image list value * * Can be called for types : -- GitLab