iLand
Public Member Functions | Protected Attributes | List of all members
LayeredGrid< T > Class Template Referenceabstract

This is the base class for multi-layer grids in iLand. More...

#include <layeredgrid.h>

Inheritance diagram for LayeredGrid< T >:
LayeredGridBase

Public Member Functions

 LayeredGrid (const Grid< T > &grid)
 
 LayeredGrid ()
 
bool isValid () const
 
QRectF cellRect (const QPoint &p) const
 
QRectF metricRect () const
 
float cellsize () const
 
int sizeX () const
 
int sizeY () const
 
virtual double value (const T &data, const int index) const =0
 
double value (const T *ptr, const int index) const
 
double value (const int grid_index, const int index) const
 
double value (const float x, const float y, const int index) const
 
double value (const QPointF &world_coord, const int index) const
 
double value (const int ix, const int iy, const int index) const
 
void range (double &rMin, double &rMax, const int index) const
 retrieve min and max of variable 'index' More...
 
Grid< double > * copyGrid (const int index) const
 extract a (newly created) grid filled with the value of the variable given by 'index' caller need to free memory! More...
 
- Public Member Functions inherited from LayeredGridBase
virtual ~LayeredGridBase ()
 
virtual bool onClick (const QPointF &world_coord) const
 
virtual const QVector< LayeredGridBase::LayerElement > & names ()=0
 list of stored layers More...
 
virtual int indexOf (const QString &layer_name)
 get layer index by name of the layer. returns -1 if layer is not available. More...
 
virtual QStringList layerNames ()
 
virtual const QString labelvalue (const int value, const int index) const
 

Protected Attributes

const Grid< T > * mGrid
 

Detailed Description

template<class T>
class LayeredGrid< T >

This is the base class for multi-layer grids in iLand.

template for multi-layered grids in iLand.

Use the LayeredGrid-template class for creating actual multi layer grids. The LayeredGridBase can be used for specializations.

Use your cell-class for T and provide at minium a value() and a names() function. The names() provide the names of the individual layers (used e.g. in the GUI), the value() function returns a cell-specific value for a specific layer (given by 'index' parameter).

Constructor & Destructor Documentation

◆ LayeredGrid() [1/2]

template<class T >
LayeredGrid< T >::LayeredGrid ( const Grid< T > &  grid)
inline

◆ LayeredGrid() [2/2]

template<class T >
LayeredGrid< T >::LayeredGrid ( )
inline

Member Function Documentation

◆ cellRect()

template<class T >
QRectF LayeredGrid< T >::cellRect ( const QPoint &  p) const
inlinevirtual

Implements LayeredGridBase.

◆ cellsize()

template<class T >
float LayeredGrid< T >::cellsize ( ) const
inline

◆ copyGrid()

template<class T >
Grid< double > * LayeredGrid< T >::copyGrid ( const int  index) const
inline

extract a (newly created) grid filled with the value of the variable given by 'index' caller need to free memory!

◆ isValid()

template<class T >
bool LayeredGrid< T >::isValid ( ) const
inline

◆ metricRect()

template<class T >
QRectF LayeredGrid< T >::metricRect ( ) const
inlinevirtual

Implements LayeredGridBase.

◆ range()

template<class T >
void LayeredGrid< T >::range ( double &  rMin,
double &  rMax,
const int  index 
) const
inlinevirtual

retrieve min and max of variable 'index'

Implements LayeredGridBase.

◆ sizeX()

template<class T >
int LayeredGrid< T >::sizeX ( ) const
inlinevirtual

Implements LayeredGridBase.

◆ sizeY()

template<class T >
int LayeredGrid< T >::sizeY ( ) const
inlinevirtual

Implements LayeredGridBase.

◆ value() [1/6]

template<class T >
double LayeredGrid< T >::value ( const float  x,
const float  y,
const int  index 
) const
inlinevirtual

Implements LayeredGridBase.

◆ value() [2/6]

template<class T >
double LayeredGrid< T >::value ( const int  grid_index,
const int  index 
) const
inlinevirtual

Implements LayeredGridBase.

◆ value() [3/6]

template<class T >
double LayeredGrid< T >::value ( const int  ix,
const int  iy,
const int  index 
) const
inlinevirtual

Implements LayeredGridBase.

◆ value() [4/6]

template<class T >
double LayeredGrid< T >::value ( const QPointF &  world_coord,
const int  index 
) const
inlinevirtual

Implements LayeredGridBase.

◆ value() [5/6]

template<class T >
virtual double LayeredGrid< T >::value ( const T &  data,
const int  index 
) const
pure virtual

◆ value() [6/6]

template<class T >
double LayeredGrid< T >::value ( const T *  ptr,
const int  index 
) const
inline

Member Data Documentation

◆ mGrid

template<class T >
const Grid<T>* LayeredGrid< T >::mGrid
protected

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