ZoneArray.cpp   ZoneArray.cpp 
skipping to change at line 447 skipping to change at line 447
// need for byte_swap on a LE machine means that catalog is BE // need for byte_swap on a LE machine means that catalog is BE
byte_swap byte_swap
#endif #endif
); );
} }
} }
} }
file->close(); file->close();
} }
} }
// GZ: Some diagnostics to understand the undocumented vars
around mag.
// qDebug() << "SpecialZoneArray: mag_min=" << mag_min << ",
mag_steps=" << mag_steps << ", mag_range=" << mag_range ;
} }
} }
template<class Star> template<class Star>
SpecialZoneArray<Star>::~SpecialZoneArray(void) SpecialZoneArray<Star>::~SpecialZoneArray(void)
{ {
if (stars) if (stars)
{ {
if (mmap_start != 0) if (mmap_start != 0)
{ {
skipping to change at line 488 skipping to change at line 490
const float *rcmag_table, StelCore* core, unsigned int maxMagStarNa me, const float *rcmag_table, StelCore* core, unsigned int maxMagStarNa me,
float names_brightness) const float names_brightness) const
{ {
StelSkyDrawer* drawer = core->getSkyDrawer(); StelSkyDrawer* drawer = core->getSkyDrawer();
SpecialZoneData<Star> *const z = getZones() + index; SpecialZoneData<Star> *const z = getZones() + index;
Vec3f vf; Vec3f vf;
const Star *const end = z->getStars() + z->size; const Star *const end = z->getStars() + z->size;
static const double d2000 = 2451545.0; static const double d2000 = 2451545.0;
const double movementFactor = (M_PI/180)*(0.0001/3600) * ((core->get JDay()-d2000)/365.25) / star_position_scale; const double movementFactor = (M_PI/180)*(0.0001/3600) * ((core->get JDay()-d2000)/365.25) / star_position_scale;
const float* tmpRcmag; // will point to precomputed rC in table const float* tmpRcmag; // will point to precomputed rC in table
// GZ, added for extinction
Extinction extinction=core->getSkyDrawer()->getExtinction(); Extinction extinction=core->getSkyDrawer()->getExtinction();
const bool withExtinction=(drawer->getFlagHasAtmosphere() && extinct ion.getExtinctionCoefficient()>=0.01f); const bool withExtinction=(drawer->getFlagHasAtmosphere() && extinct ion.getExtinctionCoefficient()>=0.01f);
const float k = (0.001f*mag_range)/mag_steps; // from StarMgr.cpp li ne 654 const float k = (0.001f*mag_range)/mag_steps; // from StarMgr.cpp li ne 654
// GZ: allow artificial cutoff:
const int clampStellarMagnitude_mmag = (int) floor(drawer->getCustom
StarMagnitudeLimit() * 1000.0f);
// find s->mag, which is the step into the magnitudes which is just
bright enough to be drawn.
int cutoffMagStep=(drawer->getFlagStarMagnitudeLimit() ? (clampStell
arMagnitude_mmag - mag_min)*mag_steps/mag_range : mag_steps);
// go through all stars, which are sorted by magnitude (bright stars first) // go through all stars, which are sorted by magnitude (bright stars first)
for (const Star *s=z->getStars();s<end;++s) for (const Star *s=z->getStars();s<end;++s)
{ {
if (s->mag > cutoffMagStep) break; // e.g. naked-eye stars o nly.
tmpRcmag = rcmag_table+2*s->mag; tmpRcmag = rcmag_table+2*s->mag;
if (*tmpRcmag<=0.f) break; // no size for this and following (even dimmer, unextincted) stars? --> early exit if (*tmpRcmag<=0.f) break; // no size for this and following (even dimmer, unextincted) stars? --> early exit
s->getJ2000Pos(z,movementFactor, vf); s->getJ2000Pos(z,movementFactor, vf);
const Vec3d vd(vf[0], vf[1], vf[2]); const Vec3d vd(vf[0], vf[1], vf[2]);
// GZ new:
if (withExtinction) if (withExtinction)
{ {
//GZ: We must compute position first, then shift mag nitude. //GZ: We must compute position first, then shift mag nitude.
Vec3d altAz = core->j2000ToAltAz(vd, StelCore::Refra ctionOn); Vec3d altAz = core->j2000ToAltAz(vd, StelCore::Refra ctionOn);
float extMagShift = 0.0f; float extMagShift = 0.0f;
extinction.forward(&altAz, &extMagShift); extinction.forward(&altAz, &extMagShift);
const int extMagShiftStep = const int extMagShiftStep =
qMin((int)floor(extMagShift / k), RCMAG_TABL E_SIZE-mag_steps); qMin((int)floor(extMagShift / k), RCMAG_TABL E_SIZE-mag_steps);
tmpRcmag = rcmag_table + 2 * (s->mag+extMagShiftStep if ((s->mag + extMagShiftStep) > cutoffMagStep) // i
); .e., if extincted it is dimmer than cutoff, so remove [draw with hopefully
zero size].
{
tmpRcmag = rcmag_table + 2 * (RCMAG_TABLE_SI
ZE-1);
}
else
{
tmpRcmag = rcmag_table + 2 * (s->mag+extMagS
hiftStep);
}
} }
Vec3f win; Vec3f win;
if(drawer->pointSourceVisible(&(*projector), vf, tmpRcmag, ! is_inside, win)) if(drawer->pointSourceVisible(&(*projector), vf, tmpRcmag, ! is_inside, win))
{ {
drawer->drawPointSource(win, tmpRcmag, s->bV); drawer->drawPointSource(win, tmpRcmag, s->bV);
if(s->hasName() && s->mag < maxMagStarName && s->has ComponentID()<=1) if(s->hasName() && s->mag < maxMagStarName && s->has ComponentID()<=1)
{ {
const float offset = *tmpRcmag*0.7f; const float offset = *tmpRcmag*0.7f;
const Vec3f& colorr = (StelApp::getInstance( ).getVisionModeNight() ? Vec3f(0.8f, 0.0f, 0.0f) : StelSkyDrawer::indexToCo lor(s->bV))*0.75f; const Vec3f& colorr = (StelApp::getInstance( ).getVisionModeNight() ? Vec3f(0.8f, 0.0f, 0.0f) : StelSkyDrawer::indexToCo lor(s->bV))*0.75f;
 End of changes. 6 change blocks. 
4 lines changed or deleted 24 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/