Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::Interval Class Reference

#include <MantidWSIndexDialog.h>

Public Member Functions

bool canMerge (const Interval &) const
 Returns true if it is possible to merge the given Interval with this Interval, else false. More...
 
bool contains (const Interval &) const
 Returns true if this interval completely contains the interval passed to it, else false. More...
 
int end () const
 Returns the int marking the end of this Interval. More...
 
std::set< int > getIntSet () const
 Returns a set of ints that represents the interval. More...
 
 Interval (const Interval &)
 Copy constructor. More...
 
 Interval (const QString &)
 Constructor - attempts to parse given string to find start and end. More...
 
 Interval (int single)
 Constructor - starting and ending at single. More...
 
 Interval (int start, int end)
 Constructor - starting at start and ending at end. More...
 
int length () const
 Returns the length of this interval. More...
 
bool merge (const Interval &)
 Attempts to merge the given Interval with this Interval. More...
 
int start () const
 Returns the int marking the start of this Interval. More...
 
QString toQString () const
 Returns a string which represents the start and end of this Interval. More...
 
std::string toStdString () const
 Returns a string which represents the start and end of this Interval. More...
 

Private Member Functions

void init (int, int)
 Initialise the Interval, given the specified start and end ints. More...
 

Private Attributes

int m_end
 
int m_start
 The start and end of the interval. More...
 

Detailed Description

 The MantidWSIndexDialog class presents users with a dialog so that

they may specify which workspace indices / spectra IDs are to be plotted by Mantid and the manner by which they are plotted.

 They are prompted with the available range(s) of indices/IDs they

can plot.They must enter a range(s) that is(are) enclosed within those ranges.

 "Ranges" are of a format you've probably seen when inputting page

numbers to print into a word processing program or similar, i.e. "2, 4-6" to print out pages 2, 4, 5 and 6.

 Ranges are defined by the "Interval" and "IntervalList" classes.

 The IntervalListValidator class overrides QValidator, and allows

Mantid to assertain whether a user has attempted to input a valid range or not. Altering this class will affect the behaviour of what is allowed to be typed, and what inputs allow the "OK" button to be pressed.

 TODO - perhaps the interval objects are useful elsewhere, in which

case those three classes are best in thier own header and source.

 This dialog also enables one to choose how to do the plotting.

One can choose between simple 1D plot, waterfall or tiled plot. Also the advanced form of this dialog has surface and contour plot and enables you to put a log value into the plot instead of the worksapce index or spectrum number.

 @author Peter G Parker, ISIS, RAL
 @date 2011/10/06

Definition at line 68 of file MantidWSIndexDialog.h.

Constructor & Destructor Documentation

◆ Interval() [1/4]

MantidQt::MantidWidgets::Interval::Interval ( int  single)
explicit

Constructor - starting and ending at single.

Definition at line 892 of file MantidWSIndexDialog.cpp.

References init().

◆ Interval() [2/4]

MantidQt::MantidWidgets::Interval::Interval ( int  start,
int  end 
)

Constructor - starting at start and ending at end.

Definition at line 894 of file MantidWSIndexDialog.cpp.

References end(), init(), and start().

◆ Interval() [3/4]

MantidQt::MantidWidgets::Interval::Interval ( const QString &  intervalString)
explicit

Constructor - attempts to parse given string to find start and end.

Definition at line 896 of file MantidWSIndexDialog.cpp.

References end(), init(), and start().

◆ Interval() [4/4]

MantidQt::MantidWidgets::Interval::Interval ( const Interval copy)

Copy constructor.

Definition at line 917 of file MantidWSIndexDialog.cpp.

References init(), m_end, and m_start.

Member Function Documentation

◆ canMerge()

bool MantidQt::MantidWidgets::Interval::canMerge ( const Interval other) const

Returns true if it is possible to merge the given Interval with this Interval, else false.

Definition at line 935 of file MantidWSIndexDialog.cpp.

References m_end, and m_start.

Referenced by merge().

◆ contains()

bool MantidQt::MantidWidgets::Interval::contains ( const Interval other) const

Returns true if this interval completely contains the interval passed to it, else false.

Definition at line 957 of file MantidWSIndexDialog.cpp.

References m_end, and m_start.

◆ end()

int MantidQt::MantidWidgets::Interval::end ( ) const

Returns the int marking the end of this Interval.

Definition at line 941 of file MantidWSIndexDialog.cpp.

References m_end.

Referenced by init(), and Interval().

◆ getIntSet()

std::set< int > MantidQt::MantidWidgets::Interval::getIntSet ( ) const

Returns a set of ints that represents the interval.

Definition at line 947 of file MantidWSIndexDialog.cpp.

References m_end, and m_start.

◆ init()

void MantidQt::MantidWidgets::Interval::init ( int  start,
int  end 
)
private

Initialise the Interval, given the specified start and end ints.

Definition at line 989 of file MantidWSIndexDialog.cpp.

References end(), m_end, m_start, and start().

Referenced by Interval().

◆ length()

int MantidQt::MantidWidgets::Interval::length ( ) const

Returns the length of this interval.

Definition at line 945 of file MantidWSIndexDialog.cpp.

References m_end, and m_start.

◆ merge()

bool MantidQt::MantidWidgets::Interval::merge ( const Interval other)

Attempts to merge the given Interval with this Interval.

Definition at line 919 of file MantidWSIndexDialog.cpp.

References canMerge(), m_end, and m_start.

Referenced by MantidQt::MantidWidgets::IntervalList::addInterval().

◆ start()

int MantidQt::MantidWidgets::Interval::start ( ) const

Returns the int marking the start of this Interval.

Definition at line 939 of file MantidWSIndexDialog.cpp.

References m_start.

Referenced by MantidQt::MantidWidgets::IntervalList::addInterval(), init(), and Interval().

◆ toQString()

QString MantidQt::MantidWidgets::Interval::toQString ( ) const

Returns a string which represents the start and end of this Interval.

Definition at line 972 of file MantidWSIndexDialog.cpp.

References m_end, and m_start.

◆ toStdString()

std::string MantidQt::MantidWidgets::Interval::toStdString ( ) const

Returns a string which represents the start and end of this Interval.

Definition at line 959 of file MantidWSIndexDialog.cpp.

References m_end, and m_start.

Member Data Documentation

◆ m_end

int MantidQt::MantidWidgets::Interval::m_end
private

◆ m_start

int MantidQt::MantidWidgets::Interval::m_start
private

The start and end of the interval.

Definition at line 109 of file MantidWSIndexDialog.h.

Referenced by canMerge(), contains(), getIntSet(), init(), Interval(), length(), merge(), start(), toQString(), and toStdString().


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