ZoneArray.cpp   ZoneArray.cpp 
skipping to change at line 17 skipping to change at line 17
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <io.h> #include <io.h>
#include <windows.h> #include <windows.h>
#endif #endif
#include "ZoneArray.hpp" #include "ZoneArray.hpp"
skipping to change at line 479 skipping to change at line 479
zones = NULL; zones = NULL;
} }
nr_of_zones = 0; nr_of_zones = 0;
nr_of_stars = 0; nr_of_stars = 0;
} }
template<class Star> template<class Star>
void SpecialZoneArray<Star>::draw(StelPainter* sPainter, int index, bool is _inside, const float *rcmag_table, StelCore* core, unsigned int maxMagStarN ame, void SpecialZoneArray<Star>::draw(StelPainter* sPainter, int index, bool is _inside, const float *rcmag_table, StelCore* core, unsigned int maxMagStarN ame,
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 const double movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJDa
JDay()-d2000)/365.25) / star_position_scale; y()-d2000)/365.25) / star_position_scale;
const float* tmpRcmag; const float* tmpRcmag; // will point to precomputed rC in table
for (const Star *s=z->getStars();s<end;++s) // GZ, added for extinction
{ Extinction extinction=core->getSkyDrawer()->getExtinction();
tmpRcmag = rcmag_table+2*s->mag; const bool withExtinction=(drawer->getFlagHasAtmosphere() && extinction
if (*tmpRcmag<=0.f) .getExtinctionCoefficient()>=0.01f);
break; const float k = (0.001f*mag_range)/mag_steps; // from StarMgr.cpp line
s->getJ2000Pos(z,movementFactor, vf); 654
if (drawer->drawPointSource(sPainter, vf, tmpRcmag, s->bV, !
is_inside) && s->hasName() && s->mag < maxMagStarName && s->hasComponentID( // go through all stars, which are sorted by magnitude (bright stars fi
)<=1) rst)
{ for (const Star *s=z->getStars();s<end;++s)
const float offset = *tmpRcmag*0.7f; {
const Vec3f& colorr = (StelApp::getInstance().getVis tmpRcmag = rcmag_table+2*s->mag;
ionModeNight() ? Vec3f(0.8f, 0.2f, 0.2f) : StelSkyDrawer::indexToColor(s->b if (*tmpRcmag<=0.f) break; // no size for this and following (even d
V))*0.75f; immer, unextincted) stars? --> early exit
sPainter->setColor(colorr[0], colorr[1], colorr[2],n s->getJ2000Pos(z,movementFactor, vf);
ames_brightness);
sPainter->drawText(Vec3d(vf[0], vf[1], vf[2]), s->ge // GZ new:
tNameI18n(), 0, offset, offset, false); if (withExtinction)
} {
//GZ: We must compute position first, then shift magnitude.
Vec3d altAz=core->j2000ToAltAz(Vec3d(vf[0], vf[1], vf[2]), StelC
ore::RefractionOn);
float extMagShift=0.0f;
extinction.forward(&altAz, &extMagShift);
int extMagShiftStep=qMin((int)floor(extMagShift/k), 4096-mag_st
eps); // this number muist be equal StarMgr.cpp line 649
tmpRcmag = rcmag_table+2*(s->mag+extMagShiftStep);
}
if (drawer->drawPointSource(sPainter, vf, tmpRcmag, s->bV, !is_insid
e) && s->hasName() && s->mag < maxMagStarName && s->hasComponentID()<=1)
{
const float offset = *tmpRcmag*0.7f;
const Vec3f& colorr = (StelApp::getInstance().getVisionModeNight
() ? Vec3f(0.8f, 0.2f, 0.2f) : StelSkyDrawer::indexToColor(s->bV))*0.75f;
sPainter->setColor(colorr[0], colorr[1], colorr[2],names_brightn
ess);
sPainter->drawText(Vec3d(vf[0], vf[1], vf[2]), s->getNameI18n(),
0, offset, offset, false);
} }
}
} }
template<class Star> template<class Star>
void SpecialZoneArray<Star>::searchAround(const StelCore* core, int index, const Vec3d &v, double cosLimFov, void SpecialZoneArray<Star>::searchAround(const StelCore* core, int index, const Vec3d &v, double cosLimFov,
QList<StelObjectP > &result) QList<StelObjectP > &result)
{ {
static const double d2000 = 2451545.0; static const double d2000 = 2451545.0;
const double movementFactor = (M_PI/180.)*(0.0001/3600.) * ((core->g etJDay()-d2000)/365.25)/ star_position_scale; const double movementFactor = (M_PI/180.)*(0.0001/3600.) * ((core->g etJDay()-d2000)/365.25)/ star_position_scale;
const SpecialZoneData<Star> *const z = getZones()+index; const SpecialZoneData<Star> *const z = getZones()+index;
Vec3f tmp; Vec3f tmp;
 End of changes. 3 change blocks. 
28 lines changed or deleted 49 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/