RefractionExtinction.cpp   RefractionExtinction.cpp 
skipping to change at line 30 skipping to change at line 30
* Principal implementation: 2010-03-23 GZ=Georg Zotti, Georg.Zotti@univie. ac.at * Principal implementation: 2010-03-23 GZ=Georg Zotti, Georg.Zotti@univie. ac.at
*/ */
#include <qsettings.h> #include <qsettings.h>
#include "StelApp.hpp" #include "StelApp.hpp"
#include "RefractionExtinction.hpp" #include "RefractionExtinction.hpp"
// To be decided: The following should be either 0 or 40 (or 42? ;-) // To be decided: The following should be either 0 or 40 (or 42? ;-)
float Extinction::SUBHORIZONTAL_AIRMASS=0.0f; float Extinction::SUBHORIZONTAL_AIRMASS=0.0f;
Extinction::Extinction() : ext_coeff(0.20f) Extinction::Extinction()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
SUBHORIZONTAL_AIRMASS = (conf->value("astro/flag_extinction_below_horiz on", true).toBool()? 42.0f : 0.0f); SUBHORIZONTAL_AIRMASS = (conf->value("astro/flag_extinction_below_horiz on", true).toBool()? 42.0f : 0.0f);
ext_coeff=conf->value("landscape/atmospheric_extinction_coefficient", 0 .2f).toFloat();
} }
// altAzPos is the NORMALIZED (!!!) star position vector AFTER REFRACTION, and its z component sin(altitude). // altAzPos is the NORMALIZED (!!!) star position vector AFTER REFRACTION, and its z component sin(altitude).
void Extinction::forward(const Vec3d *altAzPos, float *mag, const int num) const void Extinction::forward(const Vec3d *altAzPos, float *mag, const int num) const
{ {
for (int i=0; i<num; ++i) mag[i] += airmass(altAzPos[i][2], true) * ext_coeff; for (int i=0; i<num; ++i) mag[i] += airmass(altAzPos[i][2], true) * ext_coeff;
} }
void Extinction::forward(const Vec3f *altAzPos, float *mag, const int num) const void Extinction::forward(const Vec3f *altAzPos, float *mag, const int num) const
{ {
for (int i=0; i<num; ++i) mag[i] += airmass(altAzPos[i][2], true) * ext_coeff; for (int i=0; i<num; ++i) mag[i] += airmass(altAzPos[i][2], true) * ext_coeff;
skipping to change at line 131 skipping to change at line 132
const double Refraction::MIN_APP_ALTITUDE_SIN=std::sin(Refraction::MIN_APP_ ALTITUDE_RAD); const double Refraction::MIN_APP_ALTITUDE_SIN=std::sin(Refraction::MIN_APP_ ALTITUDE_RAD);
const float Refraction::MIN_GEO_ALTITUDE_DEG_F=(float)Refraction::MIN_GEO_A LTITUDE_DEG; const float Refraction::MIN_GEO_ALTITUDE_DEG_F=(float)Refraction::MIN_GEO_A LTITUDE_DEG;
const float Refraction::MIN_GEO_ALTITUDE_RAD_F=(float)Refraction::MIN_GEO_A LTITUDE_RAD; const float Refraction::MIN_GEO_ALTITUDE_RAD_F=(float)Refraction::MIN_GEO_A LTITUDE_RAD;
const float Refraction::MIN_GEO_ALTITUDE_SIN_F=(float)Refraction::MIN_GEO_A LTITUDE_SIN; const float Refraction::MIN_GEO_ALTITUDE_SIN_F=(float)Refraction::MIN_GEO_A LTITUDE_SIN;
const float Refraction::MIN_APP_ALTITUDE_DEG_F=(float)Refraction::MIN_APP_A LTITUDE_DEG; const float Refraction::MIN_APP_ALTITUDE_DEG_F=(float)Refraction::MIN_APP_A LTITUDE_DEG;
const float Refraction::MIN_APP_ALTITUDE_RAD_F=(float)Refraction::MIN_APP_A LTITUDE_RAD; const float Refraction::MIN_APP_ALTITUDE_RAD_F=(float)Refraction::MIN_APP_A LTITUDE_RAD;
const float Refraction::MIN_APP_ALTITUDE_SIN_F=(float)Refraction::MIN_APP_A LTITUDE_SIN; const float Refraction::MIN_APP_ALTITUDE_SIN_F=(float)Refraction::MIN_APP_A LTITUDE_SIN;
const double Refraction::TRANSITION_WIDTH_GEO_DEG_F=(float)Refraction::TRAN SITION_WIDTH_GEO_DEG; const double Refraction::TRANSITION_WIDTH_GEO_DEG_F=(float)Refraction::TRAN SITION_WIDTH_GEO_DEG;
const double Refraction::TRANSITION_WIDTH_APP_DEG_F=(float)Refraction::TRAN SITION_WIDTH_APP_DEG; const double Refraction::TRANSITION_WIDTH_APP_DEG_F=(float)Refraction::TRAN SITION_WIDTH_APP_DEG;
Refraction::Refraction() : pressure(1013.f), temperature(10.f), Refraction::Refraction() : //pressure(1013.f), temperature(10.f),
preTransfoMat(Mat4d::identity()), invertPreTransfoMat(Mat4d::identit y()), preTransfoMatf(Mat4f::identity()), invertPreTransfoMatf(Mat4f::identi ty()), preTransfoMat(Mat4d::identity()), invertPreTransfoMat(Mat4d::identit y()), preTransfoMatf(Mat4f::identity()), invertPreTransfoMatf(Mat4f::identi ty()),
postTransfoMat(Mat4d::identity()), invertPostTransfoMat(Mat4d::ident ity()), postTransfoMatf(Mat4f::identity()), invertPostTransfoMatf(Mat4f::id entity()) postTransfoMat(Mat4d::identity()), invertPostTransfoMat(Mat4d::ident ity()), postTransfoMatf(Mat4f::identity()), invertPostTransfoMatf(Mat4f::id entity())
{ {
QSettings* conf = StelApp::getInstance().getSettings();
pressure=conf->value("landscape/pressure_mbar", 1013.0f).toFloat();
temperature=conf->value("landscape/temperature_C", 15.0f).toFloat();
updatePrecomputed(); updatePrecomputed();
} }
void Refraction::setPreTransfoMat(const Mat4d& m) void Refraction::setPreTransfoMat(const Mat4d& m)
{ {
preTransfoMat=m; preTransfoMat=m;
invertPreTransfoMat=m.inverse(); invertPreTransfoMat=m.inverse();
preTransfoMatf.set(m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m [8], m[9], m[10], m[11], m[12], m[13], m[14], m[15]); preTransfoMatf.set(m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m [8], m[9], m[10], m[11], m[12], m[13], m[14], m[15]);
invertPreTransfoMatf.set(invertPreTransfoMat[0], invertPreTransfoMat [1], invertPreTransfoMat[2], invertPreTransfoMat[3], invertPreTransfoMatf.set(invertPreTransfoMat[0], invertPreTransfoMat [1], invertPreTransfoMat[2], invertPreTransfoMat[3],
invertPreTransfoMat [4], invertPreTransfoMat[5], invertPreTransfoMat[6], invertPreTransfoMat[7] , invertPreTransfoMat [4], invertPreTransfoMat[5], invertPreTransfoMat[6], invertPreTransfoMat[7] ,
 End of changes. 4 change blocks. 
2 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/