ZoneArray.cpp   ZoneArray.cpp 
skipping to change at line 33 skipping to change at line 33
#include <io.h> #include <io.h>
#include <windows.h> #include <windows.h>
#endif #endif
#include "ZoneArray.hpp" #include "ZoneArray.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelGeodesicGrid.hpp" #include "StelGeodesicGrid.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelNavigator.hpp"
namespace BigStarCatalogExtension namespace BigStarCatalogExtension
{ {
static const Vec3d north(0,0,1); static const Vec3d north(0,0,1);
void ZoneArray::initTriangle(int index, const Vec3d &c0, const Vec3d &c1, void ZoneArray::initTriangle(int index, const Vec3d &c0, const Vec3d &c1,
const Vec3d &c2) const Vec3d &c2)
{ {
// initialize center,axis0,axis1: // initialize center,axis0,axis1:
skipping to change at line 189 skipping to change at line 190
{ {
dbStr += "warning - unsupported version "; dbStr += "warning - unsupported version ";
} }
else else
{ {
// When this assertion fails you must redefine Star1 // When this assertion fails you must redefine Star1
// for your compiler. // for your compiler.
// Because your compiler does not pack the data, // Because your compiler does not pack the data,
// which is crucial for this application. // which is crucial for this application.
Q_ASSERT(sizeof(Star1) == 28); Q_ASSERT(sizeof(Star1) == 28);
rval = new HipZoneArray(file, byte_swap, use_mmap, l rval = new HipZoneArray(file, byte_swap, use_mmap, l
b, b, level, mag_min, mag_range, mag_steps);
level, mag_min, mag_range, m
ag_steps);
if (rval == 0) if (rval == 0)
{ {
dbStr += "error - no memory "; dbStr += "error - no memory ";
} }
} }
break; break;
case 1: case 1:
if (major > MAX_MAJOR_FILE_VERSION) if (major > MAX_MAJOR_FILE_VERSION)
{ {
dbStr += "warning - unsupported version "; dbStr += "warning - unsupported version ";
skipping to change at line 299 skipping to change at line 299
size -= read_rc; size -= read_rc;
data = ((char*)data) + read_rc; data = ((char*)data) + read_rc;
lb.Draw(i / parts); lb.Draw(i / parts);
i += 1.f; i += 1.f;
} }
return true; return true;
} }
void HipZoneArray::updateHipIndex(HipIndexStruct hipIndex[]) const void HipZoneArray::updateHipIndex(HipIndexStruct hipIndex[]) const
{ {
for (const SpecialZoneData<Star1> *z=getZones()+(nr_of_zones-1); for (const SpecialZoneData<Star1> *z=getZones()+(nr_of_zones-1);z>=g
z>=getZones();z--) etZones();z--)
{ {
for (const Star1 *s = z->getStars()+z->size-1;s>=z->getStars ();s--) for (const Star1 *s = z->getStars()+z->size-1;s>=z->getStars ();s--)
{ {
const int hip = s->hip; const int hip = s->hip;
if (hip < 0 || NR_OF_HIP < hip) if (hip < 0 || NR_OF_HIP < hip)
{ {
qDebug() << "ERROR: HipZoneArray::updateHipI qDebug() << "ERROR: HipZoneArray::updateHipI
ndex: invalid HP number:" ndex: invalid HIP number:" << hip;
<< hip;
exit(1); exit(1);
} }
if (hip != 0) if (hip != 0)
{ {
hipIndex[hip].a = this; hipIndex[hip].a = this;
hipIndex[hip].z = z; hipIndex[hip].z = z;
hipIndex[hip].s = s; hipIndex[hip].s = s;
} }
} }
} }
skipping to change at line 499 skipping to change at line 497
if (zones) if (zones)
{ {
delete[] getZones(); delete[] getZones();
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(int index, bool is_inside, const float *r void SpecialZoneArray<Star>::draw(int index, bool is_inside, const float *r
cmag_table, cmag_table, StelCore* core, unsigned int maxMagStarName,
const StelProjectorP& prj, unsigned int ma
xMagStarName,
float names_brightness, StelFont *starFont ) const float names_brightness, StelFont *starFont ) const
{ {
StelSkyDrawer* drawer = StelApp::getInstance().getCore()->getSkyDraw StelSkyDrawer* drawer = core->getSkyDrawer();
er(); const StelProjectorP& prj = core->getProjection(StelCore::FrameJ2000
);
SpecialZoneData<Star> *const z = getZones() + index; SpecialZoneData<Star> *const z = getZones() + index;
Vec3d xy; Vec3d xy;
const Star *const end = z->getStars() + z->size; const Star *const end = z->getStars() + z->size;
const double d2000 = 2451545.0; const double d2000 = 2451545.0;
const double movementFactor = (M_PI/180)*(0.0001/3600) * ((StarMgr:: getCurrentJDay()-d2000)/365.25) / star_position_scale; const double movementFactor = (M_PI/180)*(0.0001/3600) * ((core->get Navigator()->getJDay()-d2000)/365.25) / star_position_scale;
for (const Star *s=z->getStars();s<end;++s) for (const Star *s=z->getStars();s<end;++s)
{ {
if (is_inside ? prj->project(s->getJ2000Pos(z,movementFactor ),xy) : prj->projectCheck(s->getJ2000Pos(z,movementFactor),xy)) if (is_inside ? prj->project(s->getJ2000Pos(z,movementFactor ),xy) : prj->projectCheck(s->getJ2000Pos(z,movementFactor),xy))
{ {
if (drawer->drawPointSource(xy[0],xy[1],rcmag_table + 2*(s->mag),s->bV)==false) if (drawer->drawPointSource(xy[0],xy[1],rcmag_table + 2*(s->mag),s->bV)==false)
{ {
break; break;
} }
if (s->mag < maxMagStarName) if (s->mag < maxMagStarName)
{ {
skipping to change at line 533 skipping to change at line 531
const Vec3f& colorr = (StelApp::getI nstance().getVisionModeNight() ? Vec3f(0.8, 0.2, 0.2) : StelSkyDrawer::inde xToColor(s->bV))*0.75; const Vec3f& colorr = (StelApp::getI nstance().getVisionModeNight() ? Vec3f(0.8, 0.2, 0.2) : StelSkyDrawer::inde xToColor(s->bV))*0.75;
glColor4f(colorr[0], colorr[1], colo rr[2],names_brightness); glColor4f(colorr[0], colorr[1], colo rr[2],names_brightness);
drawer->getPainter()->drawText(starF ont,xy[0],xy[1], starname, 0, offset, offset, false); drawer->getPainter()->drawText(starF ont,xy[0],xy[1], starname, 0, offset, offset, false);
} }
} }
} }
} }
} }
template<class Star> template<class Star>
void SpecialZoneArray<Star>::searchAround(int index, const Vec3d &v, double cosLimFov, void SpecialZoneArray<Star>::searchAround(const StelNavigator* nav, int ind ex, const Vec3d &v, double cosLimFov,
QList<StelObjectP > &result) QList<StelObjectP > &result)
{ {
const double d2000 = 2451545.0; const double d2000 = 2451545.0;
const double movementFactor = (M_PI/180)*(0.0001/3600) const double movementFactor = (M_PI/180.)*(0.0001/3600.) * ((nav->ge
* ((StarMgr::getCurrentJDay()-d2000)/3 tJDay()-d2000)/365.25)/ star_position_scale;
65.25)
/ star_position_scale;
const SpecialZoneData<Star> *const z = getZones()+index; const SpecialZoneData<Star> *const z = getZones()+index;
Vec3d tmp; Vec3d tmp;
for (int i=0;i<z->size;i++) for (int i=0;i<z->size;i++)
{ {
tmp = z->getStars()[i].getJ2000Pos(z,movementFactor); tmp = z->getStars()[i].getJ2000Pos(z,movementFactor);
tmp.normalize(); tmp.normalize();
if (tmp*v >= cosLimFov) if (tmp*v >= cosLimFov)
{ {
// TODO: do not select stars that are too faint to d isplay // TODO: do not select stars that are too faint to d isplay
result.push_back(z->getStars()[i].createStelObject(t his,z)); result.push_back(z->getStars()[i].createStelObject(t his,z));
 End of changes. 9 change blocks. 
21 lines changed or deleted 16 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/