StelSkyLayerMgr.cpp   StelSkyLayerMgr.cpp 
skipping to change at line 166 skipping to change at line 166
{ {
if (!flagShow) if (!flagShow)
return; return;
StelPainter sPainter(core->getProjection(StelCore::FrameJ2000)); StelPainter sPainter(core->getProjection(StelCore::FrameJ2000));
glBlendFunc(GL_ONE, GL_ONE); glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND); glEnable(GL_BLEND);
foreach (SkyLayerElem* s, allSkyLayers) foreach (SkyLayerElem* s, allSkyLayers)
{ {
if (s->show) if (s->show)
{
if (s->layer->getFrameType() == StelCore::FrameAltAz
)
{
sPainter.setProjector(core->getProjection(St
elCore::FrameAltAz));
}
else
{
// TODO : Use the respective reference frame
s, once every SkyLayer
// object sets their frame type. Defaulting
to Equatorial frame now.
sPainter.setProjector(core->getProjection(St
elCore::FrameJ2000));
}
s->layer->draw(core, sPainter, 1.); s->layer->draw(core, sPainter, 1.);
}
} }
} }
void noDelete(StelSkyLayer*) {;} void noDelete(StelSkyLayer*) {;}
// Called when loading of data started or stopped for one collection // Called when loading of data started or stopped for one collection
void StelSkyLayerMgr::loadingStateChanged(bool b) void StelSkyLayerMgr::loadingStateChanged(bool b)
{ {
StelSkyLayer* tile = qobject_cast<StelSkyLayer*>(QObject::sender()); StelSkyLayer* tile = qobject_cast<StelSkyLayer*>(QObject::sender());
Q_ASSERT(tile!=0); Q_ASSERT(tile!=0);
skipping to change at line 242 skipping to change at line 254
progressBar = NULL; progressBar = NULL;
} }
bool StelSkyLayerMgr::loadSkyImage(const QString& id, const QString& filena me, bool StelSkyLayerMgr::loadSkyImage(const QString& id, const QString& filena me,
double ra 0, double dec0, double ra 0, double dec0,
double ra 1, double dec1, double ra 1, double dec1,
double ra 2, double dec2, double ra 2, double dec2,
double ra 3, double dec3, double ra 3, double dec3,
double mi nRes, double maxBright, bool visible) double mi nRes, double maxBright, bool visible)
{ {
if (allSkyLayers.contains("id")) if (allSkyLayers.contains(id))
{
qWarning() << "Image ID" << id << "already exists, removing
old image before loading";
removeSkyLayer(id);
}
QString path;
// Possible exception sources:
// - StelFileMgr file not found
// - list index out of range in insertSkyImage
try
{
path = StelFileMgr::findFile(filename);
QVariantMap vm;
QVariantList l;
QVariantList cl; // coordinates list for adding worldCoords
and textureCoords
QVariantList c; // a list for a pair of coordinates
QVariantList ol; // outer list - we want a structure 3 level
s deep...
vm["imageUrl"] = QVariant(path);
vm["maxBrightness"] = QVariant(maxBright);
vm["minResolution"] = QVariant(minRes);
vm["shortName"] = QVariant(id);
// textureCoords (define the ordering of worldCoords)
cl.clear();
ol.clear();
c.clear(); c.append(0); c.append(0); cl.append(QVariant(c));
c.clear(); c.append(1); c.append(0); cl.append(QVariant(c));
c.clear(); c.append(1); c.append(1); cl.append(QVariant(c));
c.clear(); c.append(0); c.append(1); cl.append(QVariant(c));
ol.append(QVariant(cl));
vm["textureCoords"] = ol;
// world coordinates
cl.clear();
ol.clear();
c.clear(); c.append(ra0); c.append(dec0); cl.append(QVariant
(c));
c.clear(); c.append(ra1); c.append(dec1); cl.append(QVariant
(c));
c.clear(); c.append(ra2); c.append(dec2); cl.append(QVariant
(c));
c.clear(); c.append(ra3); c.append(dec3); cl.append(QVariant
(c));
ol.append(QVariant(cl));
vm["worldCoords"] = ol;
StelSkyLayerP tile = StelSkyLayerP(new StelSkyImageTile(vm,
0));
tile->setFrameType(StelCore::FrameJ2000);
QString key = insertSkyLayer(tile, filename, visible);
if (key == id)
return true;
else
return false;
}
catch (std::runtime_error& e)
{
qWarning() << "Could not find image" << filename << ":" << e
.what();
return false;
}
}
bool StelSkyLayerMgr::loadSkyImageAltAz(const QString& id, const QString& f
ilename,
double al
t0, double azi0,
double al
t1, double azi1,
double al
t2, double azi2,
double al
t3, double azi3,
double mi
nRes, double maxBright, bool visible)
{
if (allSkyLayers.contains(id))
{ {
qWarning() << "Image ID" << id << "already exists, removing old image before loading"; qWarning() << "Image ID" << id << "already exists, removing old image before loading";
removeSkyLayer(id); removeSkyLayer(id);
} }
QString path; QString path;
// Possible exception sources: // Possible exception sources:
// - StelFileMgr file not found // - StelFileMgr file not found
// - list index out of range in insertSkyImage // - list index out of range in insertSkyImage
try try
skipping to change at line 279 skipping to change at line 357
c.clear(); c.append(0); c.append(0); cl.append(QVariant(c)); c.clear(); c.append(0); c.append(0); cl.append(QVariant(c));
c.clear(); c.append(1); c.append(0); cl.append(QVariant(c)); c.clear(); c.append(1); c.append(0); cl.append(QVariant(c));
c.clear(); c.append(1); c.append(1); cl.append(QVariant(c)); c.clear(); c.append(1); c.append(1); cl.append(QVariant(c));
c.clear(); c.append(0); c.append(1); cl.append(QVariant(c)); c.clear(); c.append(0); c.append(1); cl.append(QVariant(c));
ol.append(QVariant(cl)); ol.append(QVariant(cl));
vm["textureCoords"] = ol; vm["textureCoords"] = ol;
// world coordinates // world coordinates
cl.clear(); cl.clear();
ol.clear(); ol.clear();
c.clear(); c.append(dec0); c.append(ra0); cl.append(QVariant c.clear(); c.append(alt0); c.append(azi0); cl.append(QVarian
(c)); t(c));
c.clear(); c.append(dec1); c.append(ra1); cl.append(QVariant c.clear(); c.append(alt1); c.append(azi1); cl.append(QVarian
(c)); t(c));
c.clear(); c.append(dec2); c.append(ra2); cl.append(QVariant c.clear(); c.append(alt2); c.append(azi2); cl.append(QVarian
(c)); t(c));
c.clear(); c.append(dec3); c.append(ra3); cl.append(QVariant c.clear(); c.append(alt3); c.append(azi3); cl.append(QVarian
(c)); t(c));
ol.append(QVariant(cl)); ol.append(QVariant(cl));
vm["worldCoords"] = ol; vm["worldCoords"] = ol;
StelSkyLayerP tile = StelSkyLayerP(new StelSkyImageTile(vm, 0)); StelSkyLayerP tile = StelSkyLayerP(new StelSkyImageTile(vm, 0));
tile->setFrameType(StelCore::FrameAltAz);
QString key = insertSkyLayer(tile, filename, visible); QString key = insertSkyLayer(tile, filename, visible);
if (key == id) if (key == id)
return true; return true;
else else
return false; return false;
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "Could not find image" << filename << ":" << e .what(); qWarning() << "Could not find image" << filename << ":" << e .what();
return false; return false;
 End of changes. 5 change blocks. 
9 lines changed or deleted 108 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/