#include <numericitemrange.h>
|
| 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 () |
|
ItemRange * | clone () const |
|
NumericItemRange & | operator<< (const QString &itemdef) |
|
qint32 | gotoIndex (qint32 index, qint32 step) const |
|
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 |
|
ItemRange * | merge (const QSharedPointer< Range > &otherRange) const |
|
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 |
|
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
NumericItemRange::NumericItemRange |
( |
| ) |
|
void NumericItemRange::add |
( |
SPDomainItem |
item | ) |
|
|
virtual |
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
-
range | the range to be added |
Reimplemented from Ilwis::ItemRange.
void NumericItemRange::clear |
( |
| ) |
|
|
virtual |
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
-
name | name of the item |
inclusive | template 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
-
index | the (current) index |
step | step 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
-
v | The 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
-
- 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
-
raw | The 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
-
- 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
-
index | the index of the item |
- Returns
- the item
Implements Ilwis::ItemRange.
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
-
itemdef | the 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
-
nm | the 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: