kstars
#include <qcustomplot.h>
Public Member Functions  
QCPDataRange ()  
QCPDataRange (int begin, int end)  
QCPDataRange  adjusted (int changeBegin, int changeEnd) const 
int  begin () const 
QCPDataRange  bounded (const QCPDataRange &other) const 
bool  contains (const QCPDataRange &other) const 
int  end () const 
QCPDataRange  expanded (const QCPDataRange &other) const 
QCPDataRange  intersection (const QCPDataRange &other) const 
bool  intersects (const QCPDataRange &other) const 
bool  isEmpty () const 
bool  isValid () const 
int  length () const 
bool  operator!= (const QCPDataRange &other) const 
bool  operator== (const QCPDataRange &other) const 
void  setBegin (int begin) 
void  setEnd (int end) 
int  size () const 
Related Functions  
(Note that these are not member functions.)  
QDebug  operator<< (QDebug d, const QCPDataRange &dataRange) 
Detailed Description
Describes a data range given by begin and end index.
QCPDataRange holds two integers describing the begin (setBegin) and end (setEnd) index of a contiguous set of data points. The end index points to the data point above the last data point that's part of the data range, similarly to the nomenclature used in standard iterators.
Data Ranges are not bound to a certain plottable, thus they can be freely exchanged, created and modified. If a noncontiguous data set shall be described, the class QCPDataSelection is used, which holds and manages multiple instances of QCPDataRange. In most situations, QCPDataSelection is thus used.
Both QCPDataRange and QCPDataSelection offer convenience methods to work with them, e.g. bounded, expanded, intersects, intersection, adjusted, contains. Further, addition and subtraction operators (defined in QCPDataSelection) can be used to join/subtract data ranges and data selections (or mixtures), to retrieve a corresponding QCPDataSelection.
QCustomPlot's data selection mechanism is based on QCPDataSelection and QCPDataRange.
 Note
 Do not confuse QCPDataRange with QCPRange. A QCPRange describes an interval in floating point plot coordinates, e.g. the current axis range.
Definition at line 1116 of file qcustomplot.h.
Constructor & Destructor Documentation
QCPDataRange::QCPDataRange  (  ) 
Creates an empty QCPDataRange, with begin and end set to 0.
Definition at line 2198 of file qcustomplot.cpp.
QCPDataRange::QCPDataRange  (  int  begin, 
int  end  
) 
Creates a QCPDataRange, initialized with the specified begin and end.
No checks or corrections are made to ensure the resulting range is valid (isValid).
Definition at line 2207 of file qcustomplot.cpp.
Member Function Documentation

inline 
Returns a data range where changeBegin and changeEnd were added to the begin and end indices, respectively.
Definition at line 1171 of file qcustomplot.h.

inline 
Definition at line 1132 of file qcustomplot.h.
QCPDataRange QCPDataRange::bounded  (  const QCPDataRange &  other  )  const 
Returns a data range that matches this data range, except that parts exceeding other are excluded.
This method is very similar to intersection, with one distinction: If this range and the other range share no intersection, the returned data range will be empty with begin and end set to the respective boundary side of other, at which this range is residing. (intersection would just return a range with begin and end set to 0.)
Definition at line 2220 of file qcustomplot.cpp.
bool QCPDataRange::contains  (  const QCPDataRange &  other  )  const 
Returns whether all data points described by this data range are also in other.
 See also
 intersects
Definition at line 2276 of file qcustomplot.cpp.

inline 
Definition at line 1136 of file qcustomplot.h.
QCPDataRange QCPDataRange::expanded  (  const QCPDataRange &  other  )  const 
Returns a data range that contains both this data range as well as other.
Definition at line 2237 of file qcustomplot.cpp.
QCPDataRange QCPDataRange::intersection  (  const QCPDataRange &  other  )  const 
Returns the data range which is contained in both this data range and other.
This method is very similar to bounded, with one distinction: If this range and the other range share no intersection, the returned data range will be empty with begin and end set to 0. (bounded would return a range with begin and end set to one of the boundaries of other, depending on which side this range is on.)
 See also
 QCPDataSelection::intersection
Definition at line 2252 of file qcustomplot.cpp.
bool QCPDataRange::intersects  (  const QCPDataRange &  other  )  const 
Returns whether this data range and other share common data points.
 See also
 intersection, contains
Definition at line 2266 of file qcustomplot.cpp.

inline 
Returns whether this range is empty, i.e. whether its begin index equals its end index.
Definition at line 1164 of file qcustomplot.h.

inline 
Returns whether this range is valid. A valid range has a begin index greater or equal to 0, and an end index greater or equal to the begin index.
 Note
 Invalid ranges should be avoided and are never the result of any of QCustomPlot's methods (unless they are themselves fed with invalid ranges). Do not pass invalid ranges to QCustomPlot's methods. The invalid range is not inherently prevented in QCPDataRange, to allow temporary invalid begin/end values while manipulating the range. An invalid range is not necessarily empty (isEmpty), since its length can be negative and thus nonzero.
Definition at line 1160 of file qcustomplot.h.

inline 
Returns the number of data points described by this data range. Equivalent to size.
Definition at line 1144 of file qcustomplot.h.

inline 
Definition at line 1126 of file qcustomplot.h.

inline 
Definition at line 1122 of file qcustomplot.h.

inline 
Sets the begin of this data range. The begin index points to the first data point that is part of the data range.
No checks or corrections are made to ensure the resulting range is valid (isValid).
 See also
 setEnd
Definition at line 1150 of file qcustomplot.h.

inline 
Sets the end of this data range. The end index points to the data point just above the last data point that is part of the data range.
No checks or corrections are made to ensure the resulting range is valid (isValid).
 See also
 setBegin
Definition at line 1154 of file qcustomplot.h.

inline 
Returns the number of data points described by this data range. This is equal to the end index minus the begin index.
 See also
 length
Definition at line 1140 of file qcustomplot.h.
Friends And Related Function Documentation

related 
Prints dataRange in a human readable format to the qDebug output.
Definition at line 1334 of file qcustomplot.h.
The documentation for this class was generated from the following files:
Documentation copyright © 19962020 The KDE developers.
Generated on Sun May 31 2020 23:52:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 19972006
KDE's Doxygen guidelines are available online.