Mantid
|
#include <MantidWSIndexDialog.h>
Public Member Functions | |
void | addInterval (int single) |
Add an interval starting and ending at single. More... | |
void | addInterval (int start, int end) |
Add an interval starting at start and ending at end. More... | |
void | addInterval (Interval) |
Add an interval. More... | |
void | addIntervalList (const IntervalList &) |
Adds an IntervalList to this IntervalList. More... | |
void | addIntervals (QString) |
Attempts to parse the given string into a IntervalList to add. More... | |
void | clear () |
Clears the interval list. More... | |
bool | contains (const Interval &) const |
Returns true if this interval list completely contains the interval passed to it, else false. More... | |
bool | contains (const IntervalList &) const |
Returns true if this interval list completely contains the interval list passed to it, else false. More... | |
std::set< int > | getIntSet () const |
Returns a set of ints that represents the interval. More... | |
const QList< Interval > & | getList () const |
Returns a reference to the list of Intervals. More... | |
IntervalList (const Interval &) | |
Constructor - with a list containing a single Interval. More... | |
IntervalList (const QString &) | |
Constructor - with a list created by parsing the input string. More... | |
IntervalList (void) | |
Constructor - with empty list. More... | |
void | setIntervalList (const IntervalList &) |
Replaces the current list with the list belonging to given IntervalList object. More... | |
QString | toQString (int numOfIntervals=6) const |
Convenience function that returns the contents of toStdString as a QString object. More... | |
std::string | toStdString (int numOfIntervals=6) const |
Returns a string that represents the IntervalList, of the form "0, 2-5, 8, 10-12". More... | |
int | totalIntervalLength () const |
Returns the combined length of all Intervals in the list. More... | |
Static Public Member Functions | |
static IntervalList | intersect (const IntervalList &, const Interval &) |
Returns an IntervalList which is the intersection of the given IntervalList and Interval. More... | |
static IntervalList | intersect (const IntervalList &, const IntervalList &) |
Returns an IntervalList which is the intersection of the given IntervalLists. More... | |
static bool | isParsable (const QString &) |
Returns true if the QString can be parsed into an IntervalList, else false. More... | |
static bool | isParsable (const QString &, const IntervalList &) |
Returns true if the QString can be parsed into an IntervalList which can then be contained in the IntervalList given, else false. More... | |
Private Attributes | |
QList< Interval > | m_list |
A list of all the Intervals in this IntervalList. More... | |
Definition at line 112 of file MantidWSIndexDialog.h.
|
default |
Constructor - with empty list.
|
explicit |
Constructor - with a list created by parsing the input string.
Definition at line 1007 of file MantidWSIndexDialog.cpp.
References addIntervals().
|
explicit |
Constructor - with a list containing a single Interval.
Definition at line 1009 of file MantidWSIndexDialog.cpp.
References m_list.
void MantidQt::MantidWidgets::IntervalList::addInterval | ( | int | single | ) |
Add an interval starting and ending at single.
Definition at line 1054 of file MantidWSIndexDialog.cpp.
References addInterval().
Referenced by addInterval(), addIntervalList(), addIntervals(), MantidQt::MantidWidgets::MantidWSIndexWidget::generateSpectraNumIntervals(), MantidQt::MantidWidgets::MantidWSIndexWidget::generateWsIndexIntervals(), and intersect().
void MantidQt::MantidWidgets::IntervalList::addInterval | ( | int | start, |
int | end | ||
) |
Add an interval starting at start and ending at end.
Definition at line 1118 of file MantidWSIndexDialog.cpp.
References addInterval().
void MantidQt::MantidWidgets::IntervalList::addInterval | ( | Interval | interval | ) |
Add an interval.
Definition at line 1063 of file MantidWSIndexDialog.cpp.
References m_list, MantidQt::MantidWidgets::Interval::merge(), and MantidQt::MantidWidgets::Interval::start().
void MantidQt::MantidWidgets::IntervalList::addIntervalList | ( | const IntervalList & | intervals | ) |
Adds an IntervalList to this IntervalList.
Definition at line 1137 of file MantidWSIndexDialog.cpp.
References addInterval(), and getList().
void MantidQt::MantidWidgets::IntervalList::addIntervals | ( | QString | intervals | ) |
Attempts to parse the given string into a IntervalList to add.
Definition at line 1124 of file MantidWSIndexDialog.cpp.
References addInterval().
Referenced by IntervalList(), and MantidQt::MantidWidgets::MantidWSIndexWidget::plotRequested().
void MantidQt::MantidWidgets::IntervalList::clear | ( | ) |
Clears the interval list.
Definition at line 1149 of file MantidWSIndexDialog.cpp.
References m_list.
Referenced by MantidQt::MantidWidgets::MantidWSIndexWidget::validatePlotOptions().
bool MantidQt::MantidWidgets::IntervalList::contains | ( | const Interval & | other | ) | const |
Returns true if this interval list completely contains the interval passed to it, else false.
Definition at line 1162 of file MantidWSIndexDialog.cpp.
References m_list.
Referenced by isParsable().
bool MantidQt::MantidWidgets::IntervalList::contains | ( | const IntervalList & | other | ) | const |
Returns true if this interval list completely contains the interval list passed to it, else false.
Definition at line 1168 of file MantidWSIndexDialog.cpp.
std::set< int > MantidQt::MantidWidgets::IntervalList::getIntSet | ( | ) | const |
Returns a set of ints that represents the interval.
Definition at line 1151 of file MantidWSIndexDialog.cpp.
References m_list.
Referenced by MantidQt::MantidWidgets::MantidWSIndexWidget::getPlots(), and intersect().
Returns a reference to the list of Intervals.
Definition at line 1011 of file MantidWSIndexDialog.cpp.
References m_list.
Referenced by addIntervalList(), MantidQt::MantidWidgets::MantidWSIndexWidget::getPlots(), setIntervalList(), and MantidQt::MantidWidgets::MantidWSIndexWidget::usingSpectraNumbers().
|
static |
Returns an IntervalList which is the intersection of the given IntervalList and Interval.
Definition at line 1192 of file MantidWSIndexDialog.cpp.
References intersect().
Referenced by MantidQt::MantidWidgets::MantidWSIndexWidget::generateSpectraNumIntervals(), MantidQt::MantidWidgets::MantidWSIndexWidget::generateWsIndexIntervals(), and intersect().
|
static |
Returns an IntervalList which is the intersection of the given IntervalLists.
Definition at line 1198 of file MantidWSIndexDialog.cpp.
References addInterval(), and getIntSet().
|
static |
Returns true if the QString can be parsed into an IntervalList, else false.
Definition at line 1183 of file MantidWSIndexDialog.cpp.
Referenced by MantidQt::MantidWidgets::IntervalListValidator::validate().
|
static |
Returns true if the QString can be parsed into an IntervalList which can then be contained in the IntervalList given, else false.
Definition at line 1174 of file MantidWSIndexDialog.cpp.
References contains().
void MantidQt::MantidWidgets::IntervalList::setIntervalList | ( | const IntervalList & | intervals | ) |
Replaces the current list with the list belonging to given IntervalList object.
Definition at line 1147 of file MantidWSIndexDialog.cpp.
References getList(), and m_list.
Referenced by MantidQt::MantidWidgets::MantidWSIndexWidget::generateSpectraNumIntervals(), and MantidQt::MantidWidgets::MantidWSIndexWidget::generateWsIndexIntervals().
QString MantidQt::MantidWidgets::IntervalList::toQString | ( | int | numOfIntervals = 6 | ) | const |
Convenience function that returns the contents of toStdString as a QString object.
Definition at line 1048 of file MantidWSIndexDialog.cpp.
References toStdString().
Referenced by MantidQt::MantidWidgets::MantidWSIndexWidget::initSpectraBox(), and MantidQt::MantidWidgets::MantidWSIndexWidget::initWorkspaceBox().
std::string MantidQt::MantidWidgets::IntervalList::toStdString | ( | int | numOfIntervals = 6 | ) | const |
Returns a string that represents the IntervalList, of the form "0, 2-5, 8, 10-12".
String is cut short by default to 6 intervals.
Definition at line 1019 of file MantidWSIndexDialog.cpp.
References m_list.
Referenced by toQString().
int MantidQt::MantidWidgets::IntervalList::totalIntervalLength | ( | ) | const |
Returns the combined length of all Intervals in the list.
Definition at line 1013 of file MantidWSIndexDialog.cpp.
References m_list.
Referenced by MantidQt::MantidWidgets::MantidWSIndexWidget::validatePlotOptions().
A list of all the Intervals in this IntervalList.
Definition at line 181 of file MantidWSIndexDialog.h.
Referenced by addInterval(), clear(), contains(), getIntSet(), getList(), IntervalList(), setIntervalList(), toStdString(), and totalIntervalLength().