#include <LightBase.h>
Inheritance diagram for clLightBase:
Public Member Functions | |
clLightBase (clSimManager *p_oSimManager) | |
Constructor. | |
virtual | ~clLightBase () |
Destructor. | |
void | Action () |
Performs all light calculations. | |
void | RegisterTreeDataMembers () |
Performs data member registrations for "Light". | |
virtual float | CalcLightValue (clTree *p_oTree, clTreePopulation *p_oPop)=0 |
Calculates the light value for a particular tree. | |
clLightOrg * | GetLightOrg () |
Gets the light org object. | |
Protected Member Functions | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Triggers all light setup. | |
virtual void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
If a descendent class has specific setup needs, it can overload this function. | |
void | PopulateGLIBrightnessArray () |
Populates the GLI brightness array. | |
void | PopulateSailLightBrightnessArray () |
Populates the sail brightness array. | |
float | GetDayAngle (int iJulianDay) |
Computes day angle. | |
float | GetDeclination (float &fDayAngle) |
Computes solar declination. | |
float | GetEccentricity (float &fDayAngle) |
Computes solar eccentricity. | |
float | GetSunrise (float &fLatInRadians, float &fDeclination) |
Computes sunrise. | |
float | GetCosineOfZenithAngle (float &fDeclination, float &fLatInRadians, float &fTimeNow) |
Computes cosine of the zenith angle of the sun at a given time. | |
float | GetAltitudeAngle (float &fCosZenAng) |
Computes altitude angle of the sun at a given time in radians. | |
float | GetAzimuthAngle (float &fDeclination, float &fLatInRadians, float &fAltInRad, float &fTimeNow) |
Computes azimuth angle of the sun at a given time in radians in SORTIE azimuth coordinates. | |
float | GetAirmassEffect (float &fAltInDeg, float &fCosZenAng) |
Computes the airmass effect for a given altitude angle. | |
float | GetBeamRadiation (float &fClearSkyTransCoeff, float &fAirmass, float &fEccentricity, float &fCosZenAng) |
Computes beam radiation strength. | |
virtual float | GetLightExtinctionCoefficient (clTree *p_oTree) |
Gets the light extinction coefficent. | |
Protected Attributes | |
bool | m_bHooked |
Whether or not this shell object is hooked to clLightOrg. | |
bool | m_bNeedsCommonParameters |
Whether or not this shell object requires the common light parameters held in clLightOrg such as clLightOrg::m_iLastJulDay. | |
float ** | mp_fBrightness |
Sky brightness array. | |
float ** | mp_fPhoto |
Simulated fisheye photo array. | |
float | m_fMinSunAngle |
The altitude angle below which the sky is assumed to be dark. | |
int | m_iNumAziAng |
Number of azimuth angles into which the sky hemisphere is divided. | |
int | m_iNumAltAng |
Number of altitude angles into which the sky hemisphere is divided. | |
int | m_iMinAngRow |
Row in the brightness array corresponding to the minimum solar angle. | |
Static Protected Attributes | |
static clLightOrg * | mp_oLightOrg |
clLightOrg object - this pointer is held in common by all shells | |
Friends | |
class | clLightOrg |
class | clGliLight |
class | clQuadratGliLight |
class | clGLIMap |
class | clGLIPoints |
This is the base class for light behavior shell classes. These shells implement a common set of functions in different ways which are specific to the way light is calculated according to their method.
The bulk of the organizational work is done by the class clLightOrg, which calls the needed shell functions for each tree. The clLightOrg object hooks into one particular light shell object, which calls clLightOrg when it is triggered by the behavior manager. It does not particularly matter which shell object is hooked; the first one will suffice. Any non-hooked shells do nothing when their Action() and other functions are called. The hooked shell also tells this object that it's time to register tree data members.
Every object made from this class or a descendent class must have the string "lightshell" in its namestring somewhere. The base class also declares a new tree float data member on behalf of each child shell object; the light org object then registers it. The descendents don't need to do anything. The new data member is called "Light", and will store the amount of light calculated.
Copyright 2003 Charles D. Canham.
|
Constructor. Checks to see if the light org object has been created - if not, it creates it. Sets m_bNeedsCommonParameters to true, its default.
|
|
Destructor. Deletes the light org object if it was the hooked object. |
|
Performs all light calculations. This will be the same for all descendent classes - they do not need to override. If a particular object is hooked, it calls the light org object's DoLightAssignments. Otherwise it does nothing. Reimplemented from clBehaviorBase. Reimplemented in clGLIMap, clGLIPoints, and clLightDepSeedSurvival. |
|
Calculates the light value for a particular tree. This must be overridden by all child classes. The reason that the function does not just assign the value to the tree is because the data codes are managed by the light org object.
Implemented in clBasalAreaLight, clGapLight, clGliLight, clGLIMap, clGLIPoints, clLightDepSeedSurvival, clQuadratGliLight, clRadialLight, and clSailLight. |
|
If a descendent class has specific setup needs, it can overload this function.
Reimplemented in clBasalAreaLight, clGapLight, clGliLight, clQuadratGliLight, and clSailLight. |
|
Computes the airmass effect for a given altitude angle.
|
|
Computes altitude angle of the sun at a given time in radians.
|
|
Computes azimuth angle of the sun at a given time in radians in SORTIE azimuth coordinates.
|
|
Computes beam radiation strength.
|
|
Computes cosine of the zenith angle of the sun at a given time. This is needed in other calculations.
|
|
Triggers all light setup. This will be the same for all descendent classes. If a particular object is hooked, it calls the light org object's DoSetup() function. Then it calls the function DoShellSetup() - if a descendent class has specific setup needs, it can overload that function.
Implements clWorkerBase. Reimplemented in clGLIMap, clGLIPoints, and clLightDepSeedSurvival. |
|
Computes day angle.
|
|
Computes solar declination.
|
|
Computes solar eccentricity.
|
|
Gets the light extinction coefficent. This passes this through to clLightOrg::GetLightExtCoeff(). This structure allows for overriding by child classes if necessary.
Reimplemented in clLightDepSeedSurvival. |
|
Gets the light org object.
|
|
Computes sunrise.
|
|
Populates the GLI brightness array. Yes, yes, this isn't strictly a function common to all light shells, but it's common to more than one. Plus it's really similar to the sail light brightness array calculator and I may merge them at some point. This assumes that the brightness array has already been allocated. |
|
Populates the sail brightness array. This is so similar to the GLI brightness array function that I wanted them together so I could consider merging them later. But right now it's too much, what with one doing all calcs in radians and one in degrees. If that seems trivial to you, you're welcome to do it yourself. This assumes that the brightness array has already been allocated. |
|
Performs data member registrations for "Light". This will be the same for all descendent classes - they do not need to override. If a particular object is hooked, it calls the light org object's DoTreeDataMemberRegistrations(). Otherwise it does nothing. Reimplemented from clBehaviorBase. Reimplemented in clLightDepSeedSurvival. |
|
Whether or not this shell object is hooked to clLightOrg. clLightOrg will set this flag. |
|
Whether or not this shell object requires the common light parameters held in clLightOrg such as clLightOrg::m_iLastJulDay. mp_oLightOrg will check this flag to see whether it should fill these values. |
|
The altitude angle below which the sky is assumed to be dark. Could be in degrees or radians. Each child object needs its own copy of this. |
|
Row in the brightness array corresponding to the minimum solar angle. Used to compare calculated object positions. Each child object needs its own copy of this. |
|
Number of altitude angles into which the sky hemisphere is divided. Each child object needs its own copy of this. |
|
Number of azimuth angles into which the sky hemisphere is divided. Each child object needs its own copy of this. |
|
Sky brightness array. Array size is # altitude angles by # azimuth angles. The altitude index increases from horizon to zenith, and the azimuth index increases from 0 to 2PI. Each child object needs its own copy of this. |
|
Simulated fisheye photo array. Array size is # altitude angles by # azimuth angles. The altitude index increases from horizon to zenith, and the azimuth index increases from 0 to 2PI. Each child object needs its own copy of this. |