iLand
Public Types | Public Member Functions | Static Public Member Functions | List of all members
HemiGrid Class Reference

HemiGrid represents a grid covering the hemisphehre as well as some operations. More...

#include <hemigrid.h>

Public Types

enum  ModifyMode { Add , Multiply , SetTo }
 

Public Member Functions

 HemiGrid ()
 
 ~HemiGrid ()
 
 HemiGrid (const HemiGrid &grid)
 
void setup (double cellsize_degree)
 
void clear (double SetWith=0.)
 
double & rGetByIndex (const int iAzimuth, const int iElevation) const
 
double & rGet (const double Azimuth, const double Elevation) const
 
int indexAzimuth (double Azimuth) const
 get azimuth index of given azimuth angle. angle should be -pi .. pi. More...
 
int indexElevation (double Elevation) const
 get index of elevation (0..pi/2) More...
 
double azimuth (const int iAzimuth)
 get azimuth angle associated with given index. More...
 
double azimuthNorth (const int iAzimuth)
 get azimuth angle associated with given index. More...
 
double elevation (const int iElevation)
 get elevation angle associated with given index. More...
 
int matrixCountAzimuth () const
 
int matrixCountElevation () const
 
void matrixMinMax (double &rMatrixMin, double &rMatrixMax) const
 get mininum and maximum value in the grid. More...
 
double sum (const double elevation=0) const
 get sum of all cell values with elevation >= "elevation". More...
 
void modify (const HemiGrid &Source, const ModifyMode mode)
 combine two Hemigrids. More...
 
void projectCylinder (const double &deltax, const double &deltay, const double &offsetz, const double &height, const double &r, const ModifyMode mode, const double &value)
 
void modifyAngleRect (const double &elow, const double &alow1, const double &alow2, const double &ehigh, const double &ahigh1, const double &ahigh2, const ModifyMode mode, const double &value)
 
double getSum (const HemiGrid *Weighter=NULL) const
 retrieve total sum of the hemigrid. More...
 
void paintGrid (QImage &image) const
 
QString dumpGrid () const
 

Static Public Member Functions

static void projectLine (const double &x, const double &y, const double &deltah, const double &r, double &elevation, double &azimuth1, double &azimuth2)
 

Detailed Description

HemiGrid represents a grid covering the hemisphehre as well as some operations.

The sky is modeled as equally sized tiles. Coordinate system: azimuth: angle between -pi .. +pi, where 0=south direction elevation: 0: horizon - pi/2 (90°)

Member Enumeration Documentation

◆ ModifyMode

Enumerator
Add 
Multiply 
SetTo 

Constructor & Destructor Documentation

◆ HemiGrid() [1/2]

HemiGrid::HemiGrid ( )
inline

◆ ~HemiGrid()

HemiGrid::~HemiGrid ( )
inline

◆ HemiGrid() [2/2]

HemiGrid::HemiGrid ( const HemiGrid grid)
inline

Member Function Documentation

◆ azimuth()

double HemiGrid::azimuth ( const int  iAzimuth)
inline

get azimuth angle associated with given index.

Returns
from -pi .. pi.

◆ azimuthNorth()

double HemiGrid::azimuthNorth ( const int  iAzimuth)
inline

get azimuth angle associated with given index.

Returns
0 (North) -> pi/2 (West) -> pi (South) -> 3pi/2 (East)

◆ clear()

void HemiGrid::clear ( double  SetWith = 0.)

◆ dumpGrid()

QString HemiGrid::dumpGrid ( ) const

◆ elevation()

double HemiGrid::elevation ( const int  iElevation)
inline

get elevation angle associated with given index.

Returns
from 0..pi/2

◆ getSum()

double HemiGrid::getSum ( const HemiGrid Weighter = NULL) const

retrieve total sum of the hemigrid.

Parameters
Weighterif available (non null) each cell value of this grid is multiplied with the weighter grid (note: no additional calculations are performed)

◆ indexAzimuth()

int HemiGrid::indexAzimuth ( double  Azimuth) const
inline

get azimuth index of given azimuth angle. angle should be -pi .. pi.

◆ indexElevation()

int HemiGrid::indexElevation ( double  Elevation) const
inline

get index of elevation (0..pi/2)

◆ matrixCountAzimuth()

int HemiGrid::matrixCountAzimuth ( ) const
inline

◆ matrixCountElevation()

int HemiGrid::matrixCountElevation ( ) const
inline

◆ matrixMinMax()

void HemiGrid::matrixMinMax ( double &  rMatrixMin,
double &  rMatrixMax 
) const

get mininum and maximum value in the grid.

◆ modify()

void HemiGrid::modify ( const HemiGrid Source,
const ModifyMode  mode 
)

combine two Hemigrids.

use "Source" and combine it with curernt grid using the combine mode "mode". Available modes are: Add, Multiply, Set (=copy).

Parameters
SourceHemigrid used as source (is const, and not modified).
modeCombine mode (Add, Multiply, SetTo)

◆ modifyAngleRect()

void HemiGrid::modifyAngleRect ( const double &  elow,
const double &  alow1,
const double &  alow2,
const double &  ehigh,
const double &  ahigh1,
const double &  ahigh2,
const ModifyMode  mode,
const double &  value 
)

◆ paintGrid()

void HemiGrid::paintGrid ( QImage &  image) const

◆ projectCylinder()

void HemiGrid::projectCylinder ( const double &  deltax,
const double &  deltay,
const double &  offsetz,
const double &  height,
const double &  r,
const ModifyMode  mode,
const double &  value 
)

◆ projectLine()

void HemiGrid::projectLine ( const double &  x,
const double &  y,
const double &  deltah,
const double &  r,
double &  elevation,
double &  azimuth1,
double &  azimuth2 
)
static

◆ rGet()

double & HemiGrid::rGet ( const double  Azimuth,
const double  Elevation 
) const

◆ rGetByIndex()

double & HemiGrid::rGetByIndex ( const int  iAzimuth,
const int  iElevation 
) const

◆ setup()

void HemiGrid::setup ( double  cellsize_degree)

◆ sum()

double HemiGrid::sum ( const double  elevation = 0) const

get sum of all cell values with elevation >= "elevation".


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