31 #ifndef _ALGORITHM_PANORAMAALGORITHM_H
32 #define _ALGORITHM_PANORAMAALGORITHM_H
52 : o_panorama(panorama), o_successful(false)
62 virtual bool modifiesPanoramaData()
const =0;
73 o_successful = runAlgorithm();
77 template<
class AlgorithmClass>
79 AlgorithmClass& runMe()
81 AlgorithmClass& THIS =
static_cast<AlgorithmClass&
>(*this);
90 virtual bool runAlgorithm() =0;
125 m_progressDisplay(progressDisplay), m_wasCancelled(false)
149 {
return m_progressDisplay; };
153 {
return getProgressDisplay() != NULL; };
161 {
return m_wasCancelled; };
169 m_wasCancelled =
true;
170 algorithmCancelled();
177 virtual void algorithmCancelled() {};
virtual void cancelAlgorithm()
Call this when the algorithm is cancelled.
virtual bool hasProgressDisplay() const
virtual void run()
runs the algorithm.
virtual bool wasCancelled() const
virtual AppBase::ProgressDisplay * getProgressDisplay() const
TimeConsumingPanoramaAlgorithm(PanoramaData &panorama, AppBase::ProgressDisplay *progressDisplay=NULL)
[Warning! it keeps the reference to the panorama data!]
virtual ~PanoramaAlgorithm()
PanoramaAlgorithm(PanoramaData &panorama)
PanoramaData & o_panorama
virtual ~TimeConsumingPanoramaAlgorithm()
virtual bool hasRunSuccessfully()