Hugin trunk 0.1
Loading...
Searching...
No Matches
ProgressDisplay.cpp
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
26#include "ProgressDisplay.h"
27
28namespace AppBase
29{
30
31void ProgressDisplay::setMessage(const std::string& message, const std::string& filename)
32{
34 m_filename = filename;
36}
37
42
44{
45 return !m_canceled;
46}
47
49{
51 return !m_canceled;
52}
53
55{
57 {
58 ++m_progress;
59 };
61 return !m_canceled;
62}
63
72
74{
75 return m_canceled;
76}
77
79{
80 // TODO: check for Ctrl-C then cancelTask() ?
81 if (!m_message.empty())
82 {
83 // don't print empty messages
84 if (m_filename.empty())
85 {
86 m_stream << m_message << std::endl;
87 }
88 else
89 {
90 m_stream << m_message << " " << m_filename << std::endl;
91 }
92 m_stream.flush();
93 };
94}
95
96}; //namespace
void setMessage(const std::string &message, const std::string &filename="")
sets the message to given string
bool updateDisplay()
updates the display, return true, if update was successful, false if cancel was pressed
void taskFinished()
call when a task has finished and the status message should be cleared
void setMaximum(int newMaximum)
sets the new maximum value of the progress value
virtual void updateProgressDisplay()=0
Template method, updates the display.
bool wasCancelled()
return true, if process should be canceled by user e.g.
virtual void updateProgressDisplay()
update the display, print the message to stream
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41