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)  

Interval< T > Class Template Reference

Auxiliary class for interval based data. More...

#include <Interval.h>

Inheritance diagram for Interval< T >:
[legend]
Collaboration diagram for Interval< T >:
[legend]

Public Member Functions

 Interval ()=default
 
 Interval (T start, T end)
 
 Interval (const Interval< T > &)=default
 
size () const
 
bool isValid () const
 
bool touches (const Interval< T > &other) const override
 Returns true if no gap is between two intervals. More...
 
- Public Member Functions inherited from IntervalBase< T >
 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)
 
QVector< Interval< T > > operator- (QVector< Interval< T > > subtrahend)
 
QString toString () const
 Return a string in the format '[start,end]'. More...
 

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. 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 inherited from IntervalBase< T >
m_start
 Interval start. More...
 
m_end
 Interval end. More...
 

Detailed Description

template<class T>
class Interval< T >

Auxiliary class for interval based data.

File : Interval.h

Project : LabPlot

Copyright : (C) 2007 by Tilman Benkert (thzs@.nosp@m.gmx..nosp@m.net) Copyright : (C) 2007 by Knut Franke (knut..nosp@m.fran.nosp@m.ke@gm.nosp@m.x.de) Copyright : (C) 2012 by Alexander Semke (alexa.nosp@m.nder.nosp@m..semk.nosp@m.e@we.nosp@m.b.de) Description : Auxiliary class for interval based data

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *
  • 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.

Definition at line 212 of file Interval.h.

Constructor & Destructor Documentation

◆ Interval() [1/3]

template<class T >
Interval< T >::Interval ( )
default

◆ Interval() [2/3]

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

Definition at line 215 of file Interval.h.

◆ Interval() [3/3]

template<class T >
Interval< T >::Interval ( const Interval< T > &  )
default

Member Function Documentation

◆ isValid()

template<class T >
bool Interval< T >::isValid ( ) const
inline

Definition at line 220 of file Interval.h.

Referenced by IntervalBase< T >::restrictList(), and IntervalBase< T >::split().

◆ size()

◆ touches()

template<class T >
bool Interval< T >::touches ( const Interval< T > &  other) const
inlineoverridevirtual

Returns true if no gap is between two intervals.

Implements IntervalBase< T >.

Definition at line 224 of file Interval.h.

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

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


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