Diana Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QIntervalSet Class Reference

Collection of disjoint intervals of real numbers. More...

Inheritance diagram for QIntervalSet:
QObject

Public Member Functions

 QIntervalSet ()
 Default constructor. More...
 
 QIntervalSet (const double min, const double max)
 Constructor. More...
 
void Clear ()
 Clear() More...
 
virtual ~QIntervalSet ()
 Destructor. More...
 
void CloseGapsSmallerThan (const double smallestAllowedGap)
 Close gaps smaller than smallestAllowedGap. More...
 
bool Consolidate ()
 Consolidate overlapped intervals. More...
 
bool Contains (const double value) const
 Return whether the interval set contains a value. More...
 
const std::list< QInterval > & GetIntervals () const
 Get the list storing the intervals. More...
 
QMatrix GetMatrix ()
 Get matrix containing the intervals. More...
 
double GetMax () const
 Get maximum of all intervals in the set. More...
 
double GetMin () const
 Get minimum of all intervals in the set. More...
 
void Insert (const double min, const double max)
 Add interval to the set. More...
 
void Insert (QInterval interval)
 Add QInterval to the set. More...
 
double Length () const
 Get total length of all intervals in the set. More...
 
void RemoveIntervalsShorterThan (const double minimumLength)
 Remove intervals shorter than minimumLength. More...
 
void SetLowerBound (const double lowerBound)
 Set lower bound on the contents of the set. More...
 
void SetUpperBound (const double upperBound)
 Set upper bound on the contents of the set. More...
 
size_t Size () const
 Get number of intervals in the set. More...
 
void Dump (std::ostream &o) const
 Dump the intervals to a stream. More...
 
- Public Member Functions inherited from QObject
 QObject ()
 default constructor More...
 
virtual ~QObject ()
 destructor More...
 
QObjectoperator= (const QObject &rhs)
 operator= More...
 
void Validate ()
 make object valid More...
 
void InValidate ()
 make object non valid More...
 
bool IsValid () const
 check wheter object is valid More...
 
void SetWrite (bool write=true)
 write or not this object More...
 
bool GetWrite () const
 check wheter write or not this object More...
 
bool IsRequired () const
 check wheter this object is required by some module More...
 
void SetIsRequired (bool required=true)
 set that this object is required
More...
 
bool IsJustAdded () const
 check wheter this object has been just added by some module More...
 
void SetIsJustAdded (bool added=true)
 set that this object has been just added
More...
 
void Reset ()
 set object to non valid and calls Clear() More...
 
virtual bool Fill (QObject *evData) const =0
 calls operator= of inheriting classes. Validity flag and bits are not copied. This function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp. If evData type mismatches returns false, true otherwise. More...
 
void FullyFill (QObject *evData) const
 calls Fill(QObject*) if this QObject IsValid(). Copies Validity flag and bits More...
 
virtual QObjectDuplicate () const =0
 create object of same type, this function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp More...
 
virtual void Print () const
 print content on screen More...
 
virtual QError WriteOnStream (std::ostream &o) const
 print content to stream (intended for storage in text files) More...
 
virtual QError ReadFromStream (std::istream &o)
 fill content from stream (intended for storage in text files) More...
 
void CopyBits (QObject *obj) const
 copy validity and temporary bits to another QObject More...
 
virtual void Draw (Option_t *option="")
 

Protected Member Functions

 QObjectDef (QIntervalSet, 1)
 

Protected Attributes

std::list< QIntervalfIntervals
 Intervals in the set. More...
 
bool fIsLowerBoundSet
 Whether or not a lower bound is set. More...
 
bool fIsUpperBoundSet
 Whether or not an upper bound is set. More...
 
double fLowerBound
 Lower bound on the contents of the set. More...
 
double fUpperBound
 Upper bound on the contents of the set. More...
 

Additional Inherited Members

- Public Types inherited from QObject
enum  { kIsValid = BIT(15) , kWrite = BIT(0) , kIsRequired = BIT(1) , kIsJustAdded = BIT(2) }
 TObject bits. More...
 
- Static Public Member Functions inherited from QObject
static QObjectNew (const char *object)
 

Detailed Description

Collection of disjoint intervals of real numbers.

Author
Adam Bryant (adam_.nosp@m.brya.nosp@m.nt@be.nosp@m.rkel.nosp@m.ey.ed.nosp@m.u)

Definition at line 19 of file QIntervalSet.hh.

Constructor & Destructor Documentation

◆ QIntervalSet() [1/2]

Q_BEGIN_NAMESPACE QIntervalSet::QIntervalSet ( )

Default constructor.

Definition at line 10 of file QIntervalSet.cc.

◆ QIntervalSet() [2/2]

QIntervalSet::QIntervalSet ( const double  min,
const double  max 
)

Constructor.

Definition at line 15 of file QIntervalSet.cc.

References fIntervals, max, and min().

◆ ~QIntervalSet()

virtual QIntervalSet::~QIntervalSet ( )
inlinevirtual

Destructor.

Definition at line 31 of file QIntervalSet.hh.

Member Function Documentation

◆ Clear()

void QIntervalSet::Clear ( )
virtual

◆ CloseGapsSmallerThan()

void QIntervalSet::CloseGapsSmallerThan ( const double  smallestAllowedGap)

Close gaps smaller than smallestAllowedGap.

Definition at line 31 of file QIntervalSet.cc.

References fIntervals, fIsLowerBoundSet, fIsUpperBoundSet, fLowerBound, fUpperBound, and Size().

◆ Consolidate()

bool QIntervalSet::Consolidate ( )

Consolidate overlapped intervals.

Returns
true if overlapped intervals found

Definition at line 69 of file QIntervalSet.cc.

References fIntervals, and max.

Referenced by Insert().

◆ Contains()

bool QIntervalSet::Contains ( const double  value) const

Return whether the interval set contains a value.

Definition at line 98 of file QIntervalSet.cc.

References fIntervals.

◆ Dump()

void QIntervalSet::Dump ( std::ostream &  o) const
virtual

Dump the intervals to a stream.

Reimplemented from QObject.

Definition at line 294 of file QIntervalSet.cc.

References fIntervals, fIsLowerBoundSet, fIsUpperBoundSet, fLowerBound, and fUpperBound.

◆ GetIntervals()

const std::list<QInterval>& QIntervalSet::GetIntervals ( ) const
inline

Get the list storing the intervals.

Definition at line 44 of file QIntervalSet.hh.

References fIntervals.

◆ GetMatrix()

QMatrix QIntervalSet::GetMatrix ( )

Get matrix containing the intervals.

Definition at line 112 of file QIntervalSet.cc.

References fIntervals, and Size().

◆ GetMax()

double QIntervalSet::GetMax ( ) const
inline

Get maximum of all intervals in the set.

Definition at line 50 of file QIntervalSet.hh.

References fIntervals.

Referenced by Insert(), and SetUpperBound().

◆ GetMin()

double QIntervalSet::GetMin ( ) const
inline

Get minimum of all intervals in the set.

Definition at line 54 of file QIntervalSet.hh.

References fIntervals.

Referenced by Insert(), and SetLowerBound().

◆ Insert() [1/2]

void QIntervalSet::Insert ( const double  min,
const double  max 
)
inline

Add interval to the set.

Definition at line 58 of file QIntervalSet.hh.

References max, and min().

◆ Insert() [2/2]

void QIntervalSet::Insert ( QInterval  interval)

◆ Length()

double QIntervalSet::Length ( ) const

Get total length of all intervals in the set.

Definition at line 238 of file QIntervalSet.cc.

References fIntervals.

◆ QObjectDef()

QIntervalSet::QObjectDef ( QIntervalSet  ,
 
)
protected

◆ RemoveIntervalsShorterThan()

void QIntervalSet::RemoveIntervalsShorterThan ( const double  minimumLength)

Remove intervals shorter than minimumLength.

Definition at line 249 of file QIntervalSet.cc.

References fIntervals.

◆ SetLowerBound()

void QIntervalSet::SetLowerBound ( const double  lowerBound)

Set lower bound on the contents of the set.

Definition at line 262 of file QIntervalSet.cc.

References fIntervals, fIsLowerBoundSet, fLowerBound, and GetMin().

◆ SetUpperBound()

void QIntervalSet::SetUpperBound ( const double  upperBound)

Set upper bound on the contents of the set.

Definition at line 278 of file QIntervalSet.cc.

References fIntervals, fIsUpperBoundSet, fUpperBound, and GetMax().

◆ Size()

size_t QIntervalSet::Size ( ) const
inline

Get number of intervals in the set.

Definition at line 77 of file QIntervalSet.hh.

References fIntervals.

Referenced by CloseGapsSmallerThan(), and GetMatrix().

Member Data Documentation

◆ fIntervals

std::list<QInterval> QIntervalSet::fIntervals
protected

◆ fIsLowerBoundSet

bool QIntervalSet::fIsLowerBoundSet
protected

Whether or not a lower bound is set.

Definition at line 87 of file QIntervalSet.hh.

Referenced by Clear(), CloseGapsSmallerThan(), Dump(), Insert(), and SetLowerBound().

◆ fIsUpperBoundSet

bool QIntervalSet::fIsUpperBoundSet
protected

Whether or not an upper bound is set.

Definition at line 90 of file QIntervalSet.hh.

Referenced by Clear(), CloseGapsSmallerThan(), Dump(), Insert(), and SetUpperBound().

◆ fLowerBound

double QIntervalSet::fLowerBound
protected

Lower bound on the contents of the set.

Definition at line 93 of file QIntervalSet.hh.

Referenced by Clear(), CloseGapsSmallerThan(), Dump(), Insert(), and SetLowerBound().

◆ fUpperBound

double QIntervalSet::fUpperBound
protected

Upper bound on the contents of the set.

Definition at line 96 of file QIntervalSet.hh.

Referenced by Clear(), CloseGapsSmallerThan(), Dump(), Insert(), and SetUpperBound().


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