diff --git a/Code/ApplicationEngine/otbWrapperApplication.cxx b/Code/ApplicationEngine/otbWrapperApplication.cxx index b2c52b1e5fd9e9b90fc82011f7a4a08092220e32..807e01de5c4f166c45e7db45832994787d1d3f10 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.cxx +++ b/Code/ApplicationEngine/otbWrapperApplication.cxx @@ -762,11 +762,25 @@ Application::IsApplicationReady() void Application::AddProcess(itk::ProcessObject* object, std::string description) { + m_ProgressSource = object; + m_ProgressSourceDescription = description; + AddProcessToWatchEvent event; event.SetProcess(object); event.SetProcessDescription(description); this->InvokeEvent(event); } +itk::ProcessObject* Application::GetProgressSource() const +{ + return m_ProgressSource; +} + +std::string Application::GetProgressDescription() const +{ + return m_ProgressSourceDescription; +} + + } } diff --git a/Code/ApplicationEngine/otbWrapperApplication.h b/Code/ApplicationEngine/otbWrapperApplication.h index 21d942f355eab3c6f082e64502f105cb80be8596..d83260be3f368577621630948ef8c9a653965d8e 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.h +++ b/Code/ApplicationEngine/otbWrapperApplication.h @@ -337,7 +337,10 @@ public: itk::Logger* GetLogger(); - void AddProcess(itk::ProcessObject* object, std::string description); + itk::ProcessObject* GetProgressSource() const; + + std::string GetProgressDescription() const; + protected: /** Constructor */ @@ -346,6 +349,9 @@ protected: /** Destructor */ virtual ~Application(); + /* Register a ProcessObject as a new progress source */ + void AddProcess(itk::ProcessObject* object, std::string description); + /** Add a new choice value to an existing choice parameter */ void AddChoice(std::string paramKey, std::string paramName); @@ -388,6 +394,9 @@ private: itk::Logger::Pointer m_Logger; + itk::ProcessObject::Pointer m_ProgressSource; + std::string m_ProgressSourceDescription; + }; //end class } // end namespace Wrapper diff --git a/Code/Wrappers/SWIG/itkBase.i b/Code/Wrappers/SWIG/itkBase.i index a56792c52f53676ba75477c05f85f0561d260270..0362211e814337df2d8de67105d355b6febda944 100644 --- a/Code/Wrappers/SWIG/itkBase.i +++ b/Code/Wrappers/SWIG/itkBase.i @@ -166,6 +166,7 @@ class itkIndent { public: //static itkProcessObject_Pointer New(); virtual itkLightObject_Pointer CreateAnother() const; + const float& GetProgress(); private: itkProcessObject(itkProcessObject const & arg0); void operator=(itkProcessObject const & arg0); diff --git a/Code/Wrappers/SWIG/otbApplication.i b/Code/Wrappers/SWIG/otbApplication.i index ce4ea5a77c99ead77ab09be32dad7b3ba36a6275..87493f26d2d889d325efb2317981abe9d5fb0cf0 100644 --- a/Code/Wrappers/SWIG/otbApplication.i +++ b/Code/Wrappers/SWIG/otbApplication.i @@ -134,6 +134,10 @@ public: std::string GetParameterAsString(std::string paramKey); + itkProcessObject* GetProgressSource() const; + + std::string GetProgressDescription() const; + protected: Application(); //virtual ~Application();