ACF $AcfVersion:0$
Public Types | Public Member Functions | List of all members
istd::TRanges< ValueType > Class Template Reference

Set of ranges. More...

#include <TRanges.h>

Public Types

typedef QList< TRange< ValueType > > RangeList
 
typedef std::vector< TRange< ValueType > > RangeVector
 
typedef std::set< ValueType > SwitchPoints
 

Public Member Functions

 TRanges ()
 Default constructor initializing this set to be empty.
 
 TRanges (const istd::TRange< ValueType > &range)
 Convert from simple range.
 
void Reset ()
 Set this set to be empty.
 
bool IsEmpty () const
 Check if this set is empty.
 
const SwitchPointsGetSwitchPoints () const
 Get stored switch points.
 
SwitchPointsGetSwitchPointsRef ()
 Allows access to stored switch points.
 
void InsertSwitchPoint (ValueType point)
 Insert new switch point.
 
bool GetBeginState () const
 Get begin state.
 
void SetBeginState (bool state)
 Set begin state.
 
bool IsInside (ValueType point) const
 Check if some point belongs to set.
 
bool IsInside (const TRange< ValueType > &range) const
 Check if some range belongs to set.
 
bool IsInside (const TRanges< ValueType > &rangesList) const
 Check if some other set belongs to this set.
 
void GetInverted (TRanges< ValueType > &result, const TRange< ValueType > *clipRangePtr) const
 Get inverted range.
 
void Invert (const TRange< ValueType > *clipRangePtr)
 Invert this range in place.
 
TRanges< ValueType > GetUnion (const TRanges< ValueType > &rangesList) const
 Get union of two range list.
 
void GetUnion (const TRanges< ValueType > &rangesList, TRanges< ValueType > &result) const
 Get union of two range lists.
 
void Union (const TRanges< ValueType > &rangesList)
 Calculate union of this range list and the other one.
 
void Union (const TRange< ValueType > &range, bool isInverted=false)
 Calculate union of this range list and some range.
 
TRanges< ValueType > GetIntersection (const TRanges< ValueType > &rangesList) const
 Get intersection of two range list.
 
void GetIntersection (const TRanges< ValueType > &rangesList, TRanges< ValueType > &result) const
 Get intersection of two range lists.
 
void Intersection (const TRanges< ValueType > &rangesList)
 Calculate intersection of this range list and the other one.
 
void Intersection (const TRange< ValueType > &range, bool isInverted=false)
 Calculate intersection of this range list and some range.
 
void Erode (ValueType leftValue, ValueType rightValue)
 Calculate erosion of this range list.
 
void Dilate (ValueType leftValue, ValueType rightValue)
 Calculate dilatation of this range list.
 
void RemoveGaps (ValueType value, bool gapState=false)
 Remove gaps with some length.
 
void ShiftRanges (ValueType offset)
 ShiftRanges all points in this set using specified offset.
 
void GetAsList (const TRange< ValueType > &range, RangeList &result) const
 Get this set as list of istd::TRange objects.
 
bool operator== (const TRanges< ValueType > &ranges) const
 
bool operator!= (const TRanges< ValueType > &ranges) const
 
uint GetHashValue (uint seed=0) const
 

Detailed Description

template<typename ValueType>
class istd::TRanges< ValueType >

Set of ranges.

This set is defined by initial begin state (state of minus infinity) and list of state switch points. Example given, set [10, 20) is represented as begin state false, and two switch points: at 10 and 20.

Definition at line 26 of file TRanges.h.

Member Typedef Documentation

◆ RangeList

template<typename ValueType >
typedef QList< TRange<ValueType> > istd::TRanges< ValueType >::RangeList

Definition at line 29 of file TRanges.h.

◆ RangeVector

template<typename ValueType >
typedef std::vector< TRange<ValueType> > istd::TRanges< ValueType >::RangeVector

Definition at line 30 of file TRanges.h.

◆ SwitchPoints

template<typename ValueType >
typedef std::set<ValueType> istd::TRanges< ValueType >::SwitchPoints

Definition at line 31 of file TRanges.h.

Constructor & Destructor Documentation

◆ TRanges() [1/2]

template<typename ValueType >
istd::TRanges< ValueType >::TRanges ( )

Default constructor initializing this set to be empty.

Definition at line 199 of file TRanges.h.

◆ TRanges() [2/2]

template<typename ValueType >
istd::TRanges< ValueType >::TRanges ( const istd::TRange< ValueType > &  range)
explicit

Member Function Documentation

◆ Dilate()

template<typename ValueType >
void istd::TRanges< ValueType >::Dilate ( ValueType  leftValue,
ValueType  rightValue 
)

Calculate dilatation of this range list.

Dilatation prolongs the ends of each range with some value for left and right side. Result is stored in this object.

Definition at line 775 of file TRanges.h.

Referenced by istd::TRanges< ValueType >::Erode().

◆ Erode()

template<typename ValueType >
void istd::TRanges< ValueType >::Erode ( ValueType  leftValue,
ValueType  rightValue 
)

Calculate erosion of this range list.

Erosion shortens the ends of each range with some value. Result is stored in this object.

Definition at line 768 of file TRanges.h.

References istd::TRanges< ValueType >::Dilate().

◆ GetAsList()

template<typename ValueType >
void istd::TRanges< ValueType >::GetAsList ( const TRange< ValueType > &  range,
RangeList result 
) const

Get this set as list of istd::TRange objects.

Parameters
rangeenclosing range. Must be provided becouse this set can represent values inclusive infinities.

Definition at line 869 of file TRanges.h.

References istd::TRange< ValueType >::GetMaxValue(), and istd::TRange< ValueType >::GetMinValue().

◆ GetBeginState()

template<typename ValueType >
bool istd::TRanges< ValueType >::GetBeginState ( ) const

Get begin state.

It is true, if values before first switch point belongs to set or not.

Definition at line 256 of file TRanges.h.

◆ GetHashValue()

template<typename ValueType >
uint istd::TRanges< ValueType >::GetHashValue ( uint  seed = 0) const

Definition at line 915 of file TRanges.h.

Referenced by istd::qHash().

◆ GetIntersection() [1/2]

template<typename ValueType >
TRanges< ValueType > istd::TRanges< ValueType >::GetIntersection ( const TRanges< ValueType > &  rangesList) const

Get intersection of two range list.

Definition at line 629 of file TRanges.h.

◆ GetIntersection() [2/2]

template<typename ValueType >
void istd::TRanges< ValueType >::GetIntersection ( const TRanges< ValueType > &  rangesList,
TRanges< ValueType > &  result 
) const

Get intersection of two range lists.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 640 of file TRanges.h.

◆ GetInverted()

template<typename ValueType >
void istd::TRanges< ValueType >::GetInverted ( TRanges< ValueType > &  result,
const TRange< ValueType > *  clipRangePtr 
) const

◆ GetSwitchPoints()

template<typename ValueType >
const TRanges< ValueType >::SwitchPoints & istd::TRanges< ValueType >::GetSwitchPoints ( ) const

Get stored switch points.

Definition at line 232 of file TRanges.h.

◆ GetSwitchPointsRef()

template<typename ValueType >
TRanges< ValueType >::SwitchPoints & istd::TRanges< ValueType >::GetSwitchPointsRef ( )

Allows access to stored switch points.

Definition at line 239 of file TRanges.h.

◆ GetUnion() [1/2]

template<typename ValueType >
TRanges< ValueType > istd::TRanges< ValueType >::GetUnion ( const TRanges< ValueType > &  rangesList) const

Get union of two range list.

Definition at line 446 of file TRanges.h.

◆ GetUnion() [2/2]

template<typename ValueType >
void istd::TRanges< ValueType >::GetUnion ( const TRanges< ValueType > &  rangesList,
TRanges< ValueType > &  result 
) const

Get union of two range lists.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 457 of file TRanges.h.

◆ InsertSwitchPoint()

template<typename ValueType >
void istd::TRanges< ValueType >::InsertSwitchPoint ( ValueType  point)

Insert new switch point.

It add the new switch point or remove it, if such switch point exist. Considering interpretation of switch points, it inverts the sets in range (point, infinity).

Definition at line 246 of file TRanges.h.

◆ Intersection() [1/2]

template<typename ValueType >
void istd::TRanges< ValueType >::Intersection ( const TRange< ValueType > &  range,
bool  isInverted = false 
)

Calculate intersection of this range list and some range.

Result is stored in this object.

Definition at line 757 of file TRanges.h.

◆ Intersection() [2/2]

template<typename ValueType >
void istd::TRanges< ValueType >::Intersection ( const TRanges< ValueType > &  rangesList)

Calculate intersection of this range list and the other one.

Result is stored in this object.

Definition at line 697 of file TRanges.h.

◆ Invert()

template<typename ValueType >
void istd::TRanges< ValueType >::Invert ( const TRange< ValueType > *  clipRangePtr)

Invert this range in place.

Definition at line 400 of file TRanges.h.

References istd::TRange< ValueType >::GetMaxValue(), istd::TRange< ValueType >::GetMinValue(), and NULL.

◆ IsEmpty()

template<typename ValueType >
bool istd::TRanges< ValueType >::IsEmpty ( ) const

Check if this set is empty.

This set is empty if no point belongs him.

Definition at line 225 of file TRanges.h.

◆ IsInside() [1/3]

template<typename ValueType >
bool istd::TRanges< ValueType >::IsInside ( const TRange< ValueType > &  range) const

Check if some range belongs to set.

Definition at line 288 of file TRanges.h.

References istd::TRange< ValueType >::GetMaxValue(), and istd::TRange< ValueType >::GetMinValue().

◆ IsInside() [2/3]

template<typename ValueType >
bool istd::TRanges< ValueType >::IsInside ( const TRanges< ValueType > &  rangesList) const

Check if some other set belongs to this set.

Definition at line 314 of file TRanges.h.

◆ IsInside() [3/3]

template<typename ValueType >
bool istd::TRanges< ValueType >::IsInside ( ValueType  point) const

Check if some point belongs to set.

Definition at line 270 of file TRanges.h.

◆ operator!=()

template<typename ValueType >
bool istd::TRanges< ValueType >::operator!= ( const TRanges< ValueType > &  ranges) const

Definition at line 908 of file TRanges.h.

◆ operator==()

template<typename ValueType >
bool istd::TRanges< ValueType >::operator== ( const TRanges< ValueType > &  ranges) const

Definition at line 901 of file TRanges.h.

◆ RemoveGaps()

template<typename ValueType >
void istd::TRanges< ValueType >::RemoveGaps ( ValueType  value,
bool  gapState = false 
)

Remove gaps with some length.

Parameters
gapStatestate interpreted as a gape. If it is false the morphological closing is done, otherwhile the morphological opening.

Definition at line 841 of file TRanges.h.

◆ Reset()

template<typename ValueType >
void istd::TRanges< ValueType >::Reset ( )

Set this set to be empty.

Definition at line 217 of file TRanges.h.

Referenced by istd::TRanges< ValueType >::GetInverted().

◆ SetBeginState()

template<typename ValueType >
void istd::TRanges< ValueType >::SetBeginState ( bool  state)

Set begin state.

Begin state is true, if values before first switch point belongs to set or not. Changing of begin state inverts the set.

Definition at line 263 of file TRanges.h.

◆ ShiftRanges()

template<typename ValueType >
void istd::TRanges< ValueType >::ShiftRanges ( ValueType  offset)

ShiftRanges all points in this set using specified offset.

Definition at line 855 of file TRanges.h.

◆ Union() [1/2]

template<typename ValueType >
void istd::TRanges< ValueType >::Union ( const TRange< ValueType > &  range,
bool  isInverted = false 
)

Calculate union of this range list and some range.

Result is stored in this object.

Definition at line 574 of file TRanges.h.

References istd::TRange< ValueType >::GetMaxValue(), istd::TRange< ValueType >::GetMinValue(), and istd::TRange< ValueType >::IsEmpty().

◆ Union() [2/2]

template<typename ValueType >
void istd::TRanges< ValueType >::Union ( const TRanges< ValueType > &  rangesList)

Calculate union of this range list and the other one.

Result is stored in this object.

Definition at line 514 of file TRanges.h.


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