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::set< ValueType > SwitchPoints
 

Public Member Functions

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

Member Typedef Documentation

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

Definition at line 28 of file TRanges.h.

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

Definition at line 29 of file TRanges.h.

Constructor & Destructor Documentation

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

Default constructor initializing this set to be empty.

Definition at line 197 of file TRanges.h.

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

Member Function Documentation

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

Referenced by istd::TRanges< ValueType >::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 766 of file TRanges.h.

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

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

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

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

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

Definition at line 922 of file TRanges.h.

Referenced by istd::qHash().

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

Get intersection of two range list.

Definition at line 627 of file TRanges.h.

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

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

Get stored switch points.

Definition at line 230 of file TRanges.h.

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

Allows access to stored switch points.

Definition at line 237 of file TRanges.h.

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

Get union of two range list.

Definition at line 444 of file TRanges.h.

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

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

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

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

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

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

Invert this range in place.

Definition at line 398 of file TRanges.h.

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

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

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

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

Check if some point belongs to set.

Definition at line 268 of file TRanges.h.

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

Check if some range belongs to set.

Definition at line 286 of file TRanges.h.

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

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

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

Definition at line 915 of file TRanges.h.

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

Definition at line 908 of file TRanges.h.

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

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

Set this set to be empty.

Definition at line 215 of file TRanges.h.

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

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

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

ShiftRanges all points in this set using specified offset.

Definition at line 862 of file TRanges.h.

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

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

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


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy