ICF 3.0.5.47
Technical documentation of ICF Libraries
istd::TRanges< ValueType > Class Template Reference

Set of ranges. More...

#include <TRanges.h>

Collaboration diagram for istd::TRanges< ValueType >:

Public Types

typedef QList< TRange< ValueType > > RangeList
 
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
 

Detailed Description

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

Set of ranges.

This set is defined by initial begin state (state of minuns 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 29 of file TRanges.h.

Member Typedef Documentation

◆ RangeList

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

Definition at line 32 of file TRanges.h.

◆ SwitchPoints

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

Definition at line 33 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 200 of file TRanges.h.

◆ TRanges() [2/2]

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

Convert from simple range.

Definition at line 207 of file TRanges.h.

References istd::TRange< ValueType >::IsEmpty().

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 776 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 769 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.
resultresult object.

Definition at line 879 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 257 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 630 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 641 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 233 of file TRanges.h.

Referenced by istd::qHash().

◆ GetSwitchPointsRef()

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

Allows access to stored switch points.

Definition at line 240 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 447 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 458 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 247 of file TRanges.h.

Referenced by iimg::CScanlineMask::CalculateMaskFromBitmap().

◆ 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 758 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 698 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 401 of file TRanges.h.

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

◆ 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 226 of file TRanges.h.

Referenced by iimg::CScanlineMask::CalculateMaskFromBitmap().

◆ 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 289 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 315 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 271 of file TRanges.h.

◆ operator!=()

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

Definition at line 918 of file TRanges.h.

◆ operator==()

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

Definition at line 911 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 851 of file TRanges.h.

◆ Reset()

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

Set this set to be empty.

Definition at line 218 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 264 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 865 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 575 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 515 of file TRanges.h.


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

© Witold Gantzke and Kirill Lepskiy