Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Member Functions | Protected Member Functions | List of all members
Ilwis::NumericItemRange Class Reference

#include <numericitemrange.h>

Inheritance diagram for Ilwis::NumericItemRange:
Ilwis::ItemRange Ilwis::Range

Public Member Functions

 NumericItemRange ()
 
QVariant impliedValue (const QVariant &v) const
 
quint32 count () const
 
SPDomainItem item (quint32 index) const
 
SPDomainItem item (const QString &def) const
 
SPDomainItem itemByOrder (quint32 index) const
 
virtual double index (double v) const
 
bool contains (const QVariant &name, bool inclusive=true) const
 
bool isValid () const
 
void add (DomainItem *item)
 
void add (SPDomainItem item)
 
void remove (const QString &nm)
 
QString toString () const
 
void clear ()
 
ItemRangeclone () const
 
NumericItemRangeoperator<< (const QString &itemdef)
 
qint32 gotoIndex (qint32 index, qint32 step) const
 
- Public Member Functions inherited from Ilwis::ItemRange
virtual bool contains (SPRange rng, bool inclusive=true) const
 
virtual bool contains (const ItemRange &itemrng, bool inclusive=true) const
 
QVariant ensure (const QVariant &v, bool inclusive=true) const
 
ItemRangemerge (const QSharedPointer< Range > &otherRange) const
 
- Public Member Functions inherited from Ilwis::Range
virtual IlwisTypes valueType () const
 valueType returns the type of values contained in the range More...
 
virtual IlwisTypes determineType () const
 determineType determines the minimal range needed type for this range. More...
 
template<typename T >
T * merge (const QSharedPointer< T > &range1, const QSharedPointer< T > &range2, RenumberMap *rnm=0)
 
virtual bool isContinuous () const
 
void interpolation (const QString &ip)
 
virtual QString interpolation () const
 

Protected Member Functions

void addRange (const ItemRange &range)
 

Additional Inherited Members

- Static Public Member Functions inherited from Ilwis::ItemRange
static DomainItemcreate (const QString &type)
 
static void addCreateItem (const QString &type, CreateItemFunc func)
 
static ItemRangemerge (const QSharedPointer< ItemRange > &nr1, const QSharedPointer< ItemRange > &nr2)
 
- Protected Attributes inherited from Ilwis::Range
IlwisTypes _vt
 
QString _interpolation
 

Detailed Description

This is a range of numeric items, for example 0-300. items can have sub ranges within this NumericItemRange. for example items in 0-300 could be 0-100, 100-200 and 200-300.

See Also
ItemRange

Constructor & Destructor Documentation

NumericItemRange::NumericItemRange ( )

Constructs an empty NumericItemRange

Member Function Documentation

void NumericItemRange::add ( DomainItem item)
virtual

Adds an item to this ItemRange.
the added item must be valid.

Parameters
itemthe item to be added

Implements Ilwis::ItemRange.

void NumericItemRange::add ( SPDomainItem  item)
virtual

Adds an item to this ItemRange.
The added item must be valid.

Parameters
itemthe item to be added

Implements Ilwis::ItemRange.

void NumericItemRange::addRange ( const ItemRange range)
protectedvirtual

adds a certain ItemRange to this range.
In the case of duplicate items, only 1 will be kept in the final result.
The range that has to be added must be valid.

Parameters
rangethe range to be added

Reimplemented from Ilwis::ItemRange.

void NumericItemRange::clear ( )
virtual

Clears all items

Implements Ilwis::ItemRange.

ItemRange * NumericItemRange::clone ( ) const
virtual

copies the range to a new instance. This pointer has to be deleted by the caller

Returns
the new Range

Implements Ilwis::Range.

bool NumericItemRange::contains ( const QVariant &  name,
bool  inclusive = true 
) const
virtual

Checks if the ItemRange contains a certain item. Returns true if there is and item which name matches the given string.

Parameters
namename of the item
inclusivetemplate parameter
Returns
true if this range contains the item

Implements Ilwis::ItemRange.

quint32 NumericItemRange::count ( ) const
virtual

Query for the amount of items in this range.
Cannot be negative

Returns
the amount of items

Implements Ilwis::ItemRange.

qint32 NumericItemRange::gotoIndex ( qint32  index,
qint32  step 
) const
virtual

combines a index and a step size into a new position the index cannot be lower as 0, neither can it be higher than the maximum index. step size may be negative.

Parameters
indexthe (current) index
stepstep size
Returns
the new index

Implements Ilwis::ItemRange.

QVariant NumericItemRange::impliedValue ( const QVariant &  v) const
virtual

Transforms a QVariant into the String representation of this value on the range.
Will only work when the given value is in this range.

Parameters
vThe QVariant you want translated
Returns
a string with the value

Implements Ilwis::ItemRange.

double NumericItemRange::index ( double  v) const
virtual

Calculates the index of a certain value v in this NumericItemRange.
Will return iUNDEF if this item range is not valid.
returns a double because of some interpolation.

Parameters
vthe value
Returns
the index of this value
bool NumericItemRange::isValid ( ) const
virtual

checks the validity of this range.

Returns
true when valid

Implements Ilwis::ItemRange.

SPDomainItem NumericItemRange::item ( quint32  raw) const
virtual

Query for an item based on the raw value of that item.
Will not work if there is no item with this raw value in the range.(returns null or undef)

Parameters
rawThe raw value of the item
Returns
the item

Implements Ilwis::ItemRange.

SPDomainItem NumericItemRange::item ( const QString &  nam) const
virtual

Query for an item based on the name of that item.
Will not work if there is no item with this name in the range.(returns null or undef)

Parameters
namthe name of the item
Returns
the item

Implements Ilwis::ItemRange.

SPDomainItem NumericItemRange::itemByOrder ( quint32  index) const
virtual

Query for an item based on the index of that item Will not work if there is no item on this index in the range.(returns null or undef)

Parameters
indexthe index of the item
Returns
the item

Implements Ilwis::ItemRange.

NumericItemRange & NumericItemRange::operator<< ( const QString &  itemdef)

override of operator<<
this operator will now try to add the string behind it to this NumericItemRange in the form of numericitems
it will fail at invalid strings

there are 2 possible valid strings, the first case is:
this << "1 2 3";
which is the simple case, it will simply add a NumericItem of the form new NumericItem(1(min),2(max),3(step))

and the second case is:
this << "1"
this requires at least 1 excisting item in the range, it will add a numeric item with as minimum the max of the last item in the current range
and as max it will have the given value (1). step size will be the same as the resolution of the first item in the range.

if anything goes wrong a ERROR1 will be thrown
be careful to make a valid item

See Also
NumericItem
Parameters
itemdefthe new item to be added
Returns
this
void NumericItemRange::remove ( const QString &  nm)
virtual

Removes an item from this range.
If there is no item of this name in the range nothing will happen.

Parameters
nmthe name of the item to be removed

Implements Ilwis::ItemRange.

QString NumericItemRange::toString ( ) const
virtual

generates a String representation of this NumericItemRange.
the will look the following way: name;name;name; for every name in this range.

Returns
a string

Implements Ilwis::Range.


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