Skip to content
Snippets Groups Projects
Commit 85ebfb00 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

ENH: added class for progress reporting (wip)

parent d9e7b06d
Branches
Tags
No related merge requests found
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbCallbackProgressReporter.h"
namespace otb
{
void
CallbackProgressReporter
::ShowProgress()
{
m_Callback->Call("ShowProgress");
}
void
CallbackProgressReporter
::StartFilter()
{
m_Callback->Call("StartFilter");
}
void
CallbackProgressReporter
::EndFilter()
{
m_Callback->Call("EndFilter");
}
}
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbCallbackProgressReporter_h
#define otbCallbackProgressReporter_h
#include "otbFilterWatcherBase.h"
#include "otbLogOutputCallback.h"
namespace otb
{
class CallbackProgressReporter : public FilterWatcherBase
{
/** Default constructor */
CallbackProgressReporter() = default;
/** Destructor. */
virtual ~CallbackProgressReporter() = default;
typedef LogOutputCallback CallbackType;
/** Set the callback method */
void SetCallback(CallbackType * callback)
{
m_Callback = callback;
}
protected:
/** Callback method to show the ProgressEvent */
virtual void ShowProgress() override;
/** Callback method to show the StartEvent */
virtual void StartFilter() override;
/** Callback method to show the EndEvent */
virtual void EndFilter() override;
private:
CallbackType * m_Callback;
};
}
#endif //otbCallbackProgressReporter_h
...@@ -34,8 +34,13 @@ set(SWIG_MODULE_otbApplication_EXTRA_DEPS ...@@ -34,8 +34,13 @@ set(SWIG_MODULE_otbApplication_EXTRA_DEPS
itkPyCommand.h itkPyCommand.h
otbLogOutputCallback.h otbLogOutputCallback.h
otbPythonLogOutput.h otbPythonLogOutput.h
otbCallbackProgressReporter.h
OTBApplicationEngine) OTBApplicationEngine)
SWIG_add_module( otbApplicationPy3 python ../otbApplication.i otbApplicationPYTHON_wrap.cxx ../python/itkPyCommand.cxx ../python/otbPythonLogOutput.cxx) SWIG_add_module( otbApplicationPy3 python ../otbApplication.i
otbApplicationPYTHON_wrap.cxx
../python/itkPyCommand.cxx
../python/otbPythonLogOutput.cxx
../python/otbCallbackProgressReporter.cxx)
SWIG_link_libraries( otbApplicationPy3 ${PYTHON3_LIBRARIES} OTBApplicationEngine ) SWIG_link_libraries( otbApplicationPy3 ${PYTHON3_LIBRARIES} OTBApplicationEngine )
set_target_properties(_otbApplicationPy3 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SWIG_OUTDIR}) set_target_properties(_otbApplicationPy3 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SWIG_OUTDIR})
set_target_properties(_otbApplicationPy3 PROPERTIES LIBRARY_OUTPUT_NAME _otbApplication) set_target_properties(_otbApplicationPy3 PROPERTIES LIBRARY_OUTPUT_NAME _otbApplication)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment