labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

IntervalBase< T > Class Template Referenceabstract

#include <Interval.h>

Inheritance diagram for IntervalBase< T >:
[legend]

Public Member Functions

 IntervalBase ()
 
 IntervalBase (T start, T end)
 
virtual ~IntervalBase ()=default
 
start () const
 
end () const
 
void setStart (T start)
 
void setEnd (T end)
 
bool contains (const Interval< T > &other) const
 
bool contains (T value) const
 
bool fuzzyContains (T value) const
 
bool intersects (const Interval< T > &other) const
 
void translate (T offset)
 
bool operator== (const Interval< T > &other) const
 
Interval< T > & operator= (const Interval< T > &other)
 
virtual bool touches (const Interval< T > &other) const =0
 Returns true if no gap is between two intervals. More...
 
QVector< Interval< T > > operator- (QVector< Interval< T > > subtrahend)
 
QString toString () const
 Return a string in the format '[start,end]'. More...
 

Static Public Member Functions

static Interval< T > intersection (const Interval< T > &first, const Interval< T > &second)
 Return the intersection of two intervals. More...
 
static Interval< T > merge (const Interval< T > &a, const Interval< T > &b)
 Merge two intervals that touch or intersect. More...
 
static QVector< Interval< T > > subtract (const Interval< T > &src_iv, const Interval< T > &minus_iv)
 Subtract an interval from another. More...
 
static QVector< Interval< T > > split (const Interval< T > &i, T before)
 Split an interval into two. More...
 
static void mergeIntervalIntoList (QVector< Interval< T > > *list, Interval< T > i)
 Merge an interval into a list. More...
 
static void restrictList (QVector< Interval< T > > *list, Interval< T > i)
 Restrict all intervals in the list to their intersection with a given interval. More...
 
static void subtractIntervalFromList (QVector< Interval< T > > *list, Interval< T > i)
 Subtract an interval from all intervals in the list. More...
 

Protected Attributes

m_start
 Interval start. More...
 
m_end
 Interval end. More...
 

Detailed Description

template<class T>
class IntervalBase< T >

Definition at line 42 of file Interval.h.

Constructor & Destructor Documentation

◆ IntervalBase() [1/2]

template<class T >
IntervalBase< T >::IntervalBase ( )
inline

Definition at line 44 of file Interval.h.

◆ IntervalBase() [2/2]

template<class T >
IntervalBase< T >::IntervalBase ( start,
end 
)
inline

◆ ~IntervalBase()

template<class T >
virtual IntervalBase< T >::~IntervalBase ( )
virtualdefault

Member Function Documentation

◆ contains() [1/2]

◆ contains() [2/2]

template<class T >
bool IntervalBase< T >::contains ( value) const
inline

Definition at line 55 of file Interval.h.

◆ end()

◆ fuzzyContains()

template<class T >
bool IntervalBase< T >::fuzzyContains ( value) const
inline

◆ intersection()

template<class T >
static Interval<T> IntervalBase< T >::intersection ( const Interval< T > &  first,
const Interval< T > &  second 
)
inlinestatic

Return the intersection of two intervals.

This function returns an invalid interval if the two intervals do not intersect.

Definition at line 66 of file Interval.h.

References IntervalBase< T >::end(), and IntervalBase< T >::start().

Referenced by IntervalBase< T >::restrictList().

◆ intersects()

template<class T >
bool IntervalBase< T >::intersects ( const Interval< T > &  other) const
inline

◆ merge()

template<class T >
static Interval<T> IntervalBase< T >::merge ( const Interval< T > &  a,
const Interval< T > &  b 
)
inlinestatic

Merge two intervals that touch or intersect.

Definition at line 80 of file Interval.h.

References IntervalBase< T >::end(), IntervalBase< T >::intersects(), IntervalBase< T >::start(), and Interval< T >::touches().

Referenced by IntervalBase< T >::mergeIntervalIntoList().

◆ mergeIntervalIntoList()

template<class T >
static void IntervalBase< T >::mergeIntervalIntoList ( QVector< Interval< T > > *  list,
Interval< T >  i 
)
inlinestatic

Merge an interval into a list.

Definition at line 127 of file Interval.h.

References IntervalBase< T >::merge().

Referenced by IntervalAttribute< bool >::removeRows(), and IntervalAttribute< bool >::setValue().

◆ operator-()

template<class T >
QVector< Interval<T> > IntervalBase< T >::operator- ( QVector< Interval< T > >  subtrahend)
inline

Definition at line 175 of file Interval.h.

References IntervalBase< T >::subtract().

◆ operator=()

template<class T >
Interval<T>& IntervalBase< T >::operator= ( const Interval< T > &  other)
inline

◆ operator==()

template<class T >
bool IntervalBase< T >::operator== ( const Interval< T > &  other) const
inline

◆ restrictList()

template<class T >
static void IntervalBase< T >::restrictList ( QVector< Interval< T > > *  list,
Interval< T >  i 
)
inlinestatic

Restrict all intervals in the list to their intersection with a given interval.

Remark: This may decrease the list size.

Definition at line 143 of file Interval.h.

References IntervalBase< T >::intersection(), and Interval< T >::isValid().

◆ setEnd()

template<class T >
void IntervalBase< T >::setEnd ( end)
inline

Definition at line 53 of file Interval.h.

References IntervalBase< T >::end(), and IntervalBase< T >::m_end.

◆ setStart()

template<class T >
void IntervalBase< T >::setStart ( start)
inline

Definition at line 52 of file Interval.h.

References IntervalBase< T >::m_start, and IntervalBase< T >::start().

◆ split()

template<class T >
static QVector< Interval<T> > IntervalBase< T >::split ( const Interval< T > &  i,
before 
)
inlinestatic

◆ start()

◆ subtract()

template<class T >
static QVector< Interval<T> > IntervalBase< T >::subtract ( const Interval< T > &  src_iv,
const Interval< T > &  minus_iv 
)
inlinestatic

◆ subtractIntervalFromList()

template<class T >
static void IntervalBase< T >::subtractIntervalFromList ( QVector< Interval< T > > *  list,
Interval< T >  i 
)
inlinestatic

Subtract an interval from all intervals in the list.

Remark: This may increase or decrease the list size.

Definition at line 160 of file Interval.h.

References IntervalBase< T >::subtract().

Referenced by IntervalAttribute< bool >::removeRows(), and IntervalAttribute< bool >::setValue().

◆ toString()

template<class T >
QString IntervalBase< T >::toString ( ) const
inline

Return a string in the format '[start,end]'.

Definition at line 192 of file Interval.h.

References IntervalBase< T >::m_end, and IntervalBase< T >::m_start.

◆ touches()

template<class T >
virtual bool IntervalBase< T >::touches ( const Interval< T > &  other) const
pure virtual

Returns true if no gap is between two intervals.

Implemented in Interval< double >, Interval< float >, Interval< long double >, and Interval< T >.

◆ translate()

template<class T >
void IntervalBase< T >::translate ( offset)
inline

Definition at line 70 of file Interval.h.

References IntervalBase< T >::m_end, and IntervalBase< T >::m_start.

Member Data Documentation

◆ m_end

◆ m_start


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