14 static const struct RegisterQwtInterval
16 inline RegisterQwtInterval() { qRegisterMetaType< QwtInterval >(); }
18 } qwtRegisterQwtInterval;
31 if ( m_minValue > m_maxValue )
35 if ( m_minValue == m_maxValue && m_borderFlags == ExcludeMinimum )
50 BorderFlags borderFlags = IncludeBorders;
52 if ( m_borderFlags & ExcludeMinimum )
53 borderFlags |= ExcludeMaximum;
55 if ( m_borderFlags & ExcludeMaximum )
56 borderFlags |= ExcludeMinimum;
58 return QwtInterval( m_maxValue, m_minValue, borderFlags );
72 if ( ( value < m_minValue ) || ( value > m_maxValue ) )
75 if ( ( value == m_minValue ) && ( m_borderFlags & ExcludeMinimum ) )
78 if ( ( value == m_maxValue ) && ( m_borderFlags & ExcludeMaximum ) )
102 if ( ( m_borderFlags & ExcludeMinimum )
111 if ( ( m_borderFlags & ExcludeMaximum )
140 BorderFlags flags = IncludeBorders;
143 if ( m_minValue < other.
minValue() )
146 flags &= m_borderFlags & ExcludeMinimum;
148 else if ( other.
minValue() < m_minValue )
156 flags &= ( m_borderFlags & other.
borderFlags() ) & ExcludeMinimum;
160 if ( m_maxValue > other.
maxValue() )
163 flags &= m_borderFlags & ExcludeMaximum;
165 else if ( other.
maxValue() > m_maxValue )
173 flags &= m_borderFlags & other.
borderFlags() & ExcludeMaximum;
222 BorderFlags flags = IncludeBorders;
255 *
this = *
this | other;
267 *
this = *
this & other;
323 qMax( qAbs( value - m_maxValue ), qAbs( value - m_minValue ) );
325 return QwtInterval( value - delta, value + delta );
338 if ( !
isValid() || lowerBound > upperBound )
341 double minValue = qMax( m_minValue, lowerBound );
342 minValue = qMin( minValue, upperBound );
344 double maxValue = qMax( m_maxValue, lowerBound );
345 maxValue = qMin( maxValue, upperBound );
347 return QwtInterval( minValue, maxValue, m_borderFlags );
369 qMax( value, m_maxValue ), m_borderFlags );
382 *
this = *
this | value;
386 #ifndef QT_NO_DEBUG_STREAM 394 debug.nospace() <<
"QwtInterval(" 400 return debug.space();
bool isValid(int axisPos)
QwtInterval symmetrize(double value) const
A class representing an interval.
Max value is not included in the interval.
QwtInterval intersect(const QwtInterval &) const
Intersect 2 intervals.
QwtInterval extend(double value) const
Extend the interval.
BorderFlags borderFlags() const
QDebug operator<<(QDebug debug, const QwtInterval &interval)
QwtInterval & operator &=(const QwtInterval &)
QwtInterval & operator|=(const QwtInterval &)
Unite this interval with the given interval.
Min value is not included in the interval.
bool contains(double value) const
void setBorderFlags(BorderFlags)
bool intersects(const QwtInterval &) const
Test if two intervals overlap.
QwtInterval unite(const QwtInterval &) const
Unite 2 intervals.
QwtInterval limited(double lowerBound, double upperBound) const
BorderFlags m_borderFlags
QwtInterval normalized() const
Normalize the limits of the interval.
QwtInterval inverted() const