SciDAVis  1.D4
Public Member Functions
Interval< T > Class Template Reference

Auxiliary class for interval based data. More...

#include <Interval.h>

Inheritance diagram for Interval< T >:
IntervalBase< T >

List of all members.

Public Member Functions

 Interval ()
 Interval (T start, T end)
 Interval (const Interval< T > &other)
bool isValid () const
size () const
bool touches (const Interval< T > &other) const
 Returns true if no gap is between two intervals.
- Public Member Functions inherited from IntervalBase< T >
bool contains (const Interval< T > &other) const
bool contains (T value) const
end () const
bool intersects (const Interval< T > &other) const
 IntervalBase ()
 IntervalBase (const IntervalBase< T > &other)
 IntervalBase (T start, T end)
QList< Interval< T > > operator- (QList< Interval< T > > subtrahend)
Interval< T > & operator= (const Interval< T > &other)
bool operator== (const Interval< T > &other) const
void setEnd (T end)
void setStart (T start)
start () const
QString toString () const
 Return a string in the format '[start,end]'.
void translate (T offset)
virtual ~IntervalBase ()

Additional Inherited Members

- Static Public Member Functions inherited from IntervalBase< T >
static Interval< T > intersection (const Interval< T > &first, const Interval< T > &second)
 Return the intersection of two intervals.
static Interval< T > merge (const Interval< T > &a, const Interval< T > &b)
 Merge two intervals that touch or intersect.
static void mergeIntervalIntoList (QList< Interval< T > > *list, Interval< T > i)
 Merge an interval into a list.
static void restrictList (QList< Interval< T > > *list, Interval< T > i)
 Restrict all intervals in the list to their intersection with a given interval.
static QList< Interval< T > > split (const Interval< T > &i, T before)
 Split an interval into two.
static QList< Interval< T > > subtract (const Interval< T > &src_iv, const Interval< T > &minus_iv)
 Subtract an interval from another.
static void subtractIntervalFromList (QList< Interval< T > > *list, Interval< T > i)
 Subtract an interval from all intervals in the list.
- Protected Attributes inherited from IntervalBase< T >
d_end
 Interval end.
d_start
 Interval start.

Detailed Description

template<class T>
class Interval< T >

Auxiliary class for interval based data.

This class represents an interval of the type [start,end]. It should be pretty self explanatory.

For the template argument (T), only numerical types ((unsigned) short, (unsigned) int, (unsigned) long, float, double, long double) are supported.


Constructor & Destructor Documentation

template<class T>
Interval< T >::Interval ( )
inline
template<class T>
Interval< T >::Interval ( start,
end 
)
inline
template<class T>
Interval< T >::Interval ( const Interval< T > &  other)
inline

Member Function Documentation

template<class T>
bool Interval< T >::isValid ( ) const
inline
template<class T>
T Interval< T >::size ( ) const
inline
template<class T>
bool Interval< T >::touches ( const Interval< T > &  other) const
inlinevirtual

Returns true if no gap is between two intervals.

Implements IntervalBase< T >.

Referenced by IntervalBase< long double >::merge().


The documentation for this class was generated from the following file: