34 #ifndef AIMS_UTILITY_PROGRESS_H 35 #define AIMS_UTILITY_PROGRESS_H 64 template <
class T1 =
double,
class T2 =
double>
79 const T2 progressmin = (T2)0,
80 const T2 progressmax = (T2)100,
81 const std::string unit =
"%",
82 const int width = 3 );
97 const double&
scale()
const;
99 double rescale(
const T1& value)
const;
103 virtual std::string
erase()
const;
106 virtual std::string
render(
const bool force =
false);
108 virtual std::string
toString()
const;
110 virtual void print(
const bool force =
false );
130 template <
class T1,
class T2>
134 std::string p = progression.
render();
146 template <
class T1,
class T2>
147 inline bool operator< (const aims::ProgressInfo<T1, T2>& l,
const T1& r){
return (l.current() < r);}
149 template <
class T1,
class T2>
150 inline bool operator< (const T1& l, const aims::ProgressInfo<T1, T2>& r){
return (l < r.current());}
152 template <
class T1,
class T2>
155 template <
class T1,
class T2>
158 template <
class T1,
class T2>
159 inline bool operator<=(const aims::ProgressInfo<T1, T2>& l,
const T1& r){
return !(l > r);}
161 template <
class T1,
class T2>
162 inline bool operator<=(const T1& l, const aims::ProgressInfo<T1, T2>& r){
return !(l > r);}
164 template <
class T1,
class T2>
167 template <
class T1,
class T2>
ProgressInfo(const T1 min, const T1 max, const T2 progressmin=(T2) 0, const T2 progressmax=(T2) 100, const std::string unit="%", const int width=3)
Constructor of the class.
ProgressInfo< T1, T2 > & operator+=(const T1 &r)
Compound assignement operator to increment internal value.
ProgressInfo< T1, T2 > & operator++()
Prefix operator to increment internal value.
const double & scale() const
Scale that is used between displayed progession range and values.
void reset()
Reset the progession to minimum value.
double rescale(const T1 &value) const
Rescale value to its progression value.
virtual void print(const bool force=false)
Print to cout if value changed or forced.
ProgressInfo< double, double > Progression
T max(const Volume< T > &vol)
virtual std::string render(const bool force=false)
Render the current progression value if changed or forced.
T1 & current()
Current value.
The class for EcatSino data write operation.
The template class used to display progression in text mode.
T min(const Volume< T > &vol)
bool operator>=(const aims::ProgressInfo< T1, T2 > &l, const T1 &r)
virtual std::string erase() const
Erase the last displayed value.
double progression() const
Current progression value.
bool operator>(const aims::ProgressInfo< T1, T2 > &l, const T1 &r)
virtual std::string toString() const
Convert progression to the display string.
MotionWriter & operator<<(MotionWriter &writer, const AffineTransformation3d &thing) __attribute__((__deprecated__("OBSOLETE")))
— OBSOLETE —