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

#include <size.h>

Public Member Functions

 Size ()
 
 Size (T x, T y, T z)
 
 Size (const Size &sz)
 
 Size (const QSize &sz)
 
Size & operator+= (const Size &sz)
 
Size & operator-= (const Size &sz)
 
Size & operator*= (double f)
 
QSize toQSize () const
 
T xsize () const
 
T ysize () const
 
T zsize () const
 
void xsize (T x)
 
void ysize (T y)
 
void zsize (T z)
 
quint64 linearSize () const
 
bool contains (T x, T y, T z=0) const
 
bool isValid () const
 
bool isNull () const
 

Detailed Description

template<typename T = quint32>
class Ilwis::Size< T >

A 3D size measurer for integer spaces. It is similar to QSize of QT but then for 3 dimension. One can freely convert between QSize and Size If no third dimension is present to top is assumed to be at 0. Fro consistency with QSize the top member is a signed integer though a unsigned would make more sense The value of size dimensions can never be below 0 and will be reset to 0 if they do.

Constructor & Destructor Documentation

template<typename T = quint32>
Ilwis::Size< T >::Size ( )
inline

default constructor, x,y,top are assumed to be at 0,0,0

template<typename T = quint32>
Ilwis::Size< T >::Size ( T  x,
T  y,
T  z 
)
inline

Initializes the Size with proper values

Parameters
xx dimension of the Size
yy dimension of the Size
zz dimension of the Size, defaults to 1.
template<typename T = quint32>
Ilwis::Size< T >::Size ( const Size< T > &  sz)
inline

Copy constructor

Parameters
otherSize
template<typename T = quint32>
Ilwis::Size< T >::Size ( const QSize< T > &  sz)
inline

Copy constructor from QSize, top goes to 0

Parameters
otherQSize

Member Function Documentation

template<typename T = quint32>
bool Ilwis::Size< T >::isNull ( ) const
inline

all dimensions are 0

Returns
true of all dimensions are 0
template<typename T = quint32>
quint64 Ilwis::Size< T >::linearSize ( ) const
inline

product of the 3 dimensions. It gives the total number of discrete points in the size. Be aware or rounding errors on float or double typed Size!

Returns
template<typename T = quint32>
Size& Ilwis::Size< T >::operator*= ( double  f)
inline

multiplies a size with a double. It decreases/increases all dimension values with the factor

Parameters
multiplier
Returns
the new size as a reference
template<typename T = quint32>
Size& Ilwis::Size< T >::operator+= ( const Size< T > &  sz)
inline

Adds a size to another Size. It extends the size with the values of the other Size

Parameters
otherSize
Returns
the new size as a reference
template<typename T = quint32>
Size& Ilwis::Size< T >::operator-= ( const Size< T > &  sz)
inline

Substract a size from another Size. It decreases the size with the values of the other Size

Parameters
otherSize
Returns
the new size as a reference
template<typename T = quint32>
QSize Ilwis::Size< T >::toQSize ( ) const
inline

returns a QSize containing the x and y dimension values of the Size. Not often needed but were an auto cast is not working, this will give the same result

Returns
template<typename T = quint32>
T Ilwis::Size< T >::xsize ( ) const
inline

returns the size in the x dimension

Returns
an 32-bits signed integers
template<typename T = quint32>
void Ilwis::Size< T >::xsize ( T  x)
inline

returns the size in the x dimension as reference. So it can function as a setter

Returns
an 32-bits signed integers
template<typename T = quint32>
T Ilwis::Size< T >::ysize ( ) const
inline

returns the size in the y dimension

Returns
an 32-bits signed integers
template<typename T = quint32>
void Ilwis::Size< T >::ysize ( T  y)
inline

returns the size in the y dimension as reference. So it can function as a setter

Returns
an 32-bits signed integers
template<typename T = quint32>
T Ilwis::Size< T >::zsize ( ) const
inline

returns the size in the z dimension

Returns
an 32-bits signed integers
template<typename T = quint32>
void Ilwis::Size< T >::zsize ( T  z)
inline

returns the size in the z dimension as reference. So it can function as a setter

Returns
an 32-bits signed integers

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