StelSkyLayerMgr.cpp   StelSkyLayerMgr.cpp 
skipping to change at line 163 skipping to change at line 163
removeSkyLayer(k); removeSkyLayer(k);
} }
// Draw all the multi-res images collection // Draw all the multi-res images collection
void StelSkyLayerMgr::draw(StelCore* core) void StelSkyLayerMgr::draw(StelCore* core)
{ {
if (!flagShow) if (!flagShow)
return; return;
StelPainter sPainter(core->getProjection(StelCore::FrameJ2000)); StelPainter sPainter(core->getProjection(StelCore::FrameJ2000));
glBlendFunc(GL_ONE, GL_ONE); sPainter.setBlending(true, GL_ONE, GL_ONE); //additive blending
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(s->layer->
) getFrameType()));
{
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)
{ {
skipping to change at line 250 skipping to change at line 240
{;} {;}
StelSkyLayerMgr::SkyLayerElem::~SkyLayerElem() StelSkyLayerMgr::SkyLayerElem::~SkyLayerElem()
{ {
if (progressBar) if (progressBar)
StelApp::getInstance().removeProgressBar(progressBar); StelApp::getInstance().removeProgressBar(progressBar);
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 double lo
0, double dec0, ng0, double lat0,
double ra double lo
1, double dec1, ng1, double lat1,
double ra double lo
2, double dec2, ng2, double lat2,
double ra double lo
3, double dec3, ng3, double lat3,
double mi double mi
nRes, double maxBright, bool visible) nRes, double maxBright, bool visible, StelCore::FrameType frameType)
{ {
if (allSkyLayers.contains(id)) 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 = StelFileMgr::findFile(filename); QString path = StelFileMgr::findFile(filename);
if (path.isEmpty()) if (path.isEmpty())
{ {
qWarning() << "Could not find image" << QDir::toNativeSepara tors(filename); qWarning() << "Could not find image" << QDir::toNativeSepara tors(filename);
return false; return false;
} }
QVariantMap vm; QVariantMap vm;
QVariantList l;
QVariantList cl; // coordinates list for adding worldCoords and text ureCoords QVariantList cl; // coordinates list for adding worldCoords and text ureCoords
QVariantList c; // a list for a pair of coordinates QVariantList c; // a list for a pair of coordinates
QVariantList ol; // outer list - we want a structure 3 levels deep.. . QVariantList ol; // outer list - we want a structure 3 levels deep.. .
vm["imageUrl"] = QVariant(path); vm["imageUrl"] = QVariant(path);
vm["maxBrightness"] = QVariant(maxBright); vm["maxBrightness"] = QVariant(maxBright);
vm["minResolution"] = QVariant(minRes); vm["minResolution"] = QVariant(minRes);
vm["shortName"] = QVariant(id); vm["shortName"] = QVariant(id);
// textureCoords (define the ordering of worldCoords) // textureCoords (define the ordering of worldCoords)
cl.clear(); cl.clear();
skipping to change at line 291 skipping to change at line 280
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(ra0); c.append(dec0); cl.append(QVariant(c)); c.clear(); c.append(long0); c.append(lat0); cl.append(QVariant(c));
c.clear(); c.append(ra1); c.append(dec1); cl.append(QVariant(c)); c.clear(); c.append(long1); c.append(lat1); cl.append(QVariant(c));
c.clear(); c.append(ra2); c.append(dec2); cl.append(QVariant(c)); c.clear(); c.append(long2); c.append(lat2); cl.append(QVariant(c));
c.clear(); c.append(ra3); c.append(dec3); cl.append(QVariant(c)); c.clear(); c.append(long3); c.append(lat3); cl.append(QVariant(c));
ol.append(QVariant(cl)); ol.append(QVariant(cl));
vm["worldCoords"] = ol; vm["worldCoords"] = ol;
vm["alphaBlend"] = true; // new 2017-3: Make black correctly see-thr
ough.
StelSkyLayerP tile = StelSkyLayerP(new StelSkyImageTile(vm, 0)); StelSkyLayerP tile = StelSkyLayerP(new StelSkyImageTile(vm, 0));
tile->setFrameType(StelCore::FrameJ2000); tile->setFrameType(frameType);
try try
{ {
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() << e.what(); qWarning() << e.what();
return false; return false;
} }
} }
// DEPRECATED, REMOVE FOR 0.16.
bool StelSkyLayerMgr::loadSkyImageAltAz(const QString& id, const QString& f ilename, bool StelSkyLayerMgr::loadSkyImageAltAz(const QString& id, const QString& f ilename,
double al t0, double azi0, double al t0, double azi0,
double al t1, double azi1, double al t1, double azi1,
double al t2, double azi2, double al t2, double azi2,
double al t3, double azi3, double al t3, double azi3,
double mi nRes, double maxBright, bool visible) double mi nRes, double maxBright, bool visible)
{ {
qDebug() << "StelSkyLayerMgr::loadSkyImageAltAz() is deprecated and
will not be available in version 0.16! Please use loadSkyImage() with AzAlt
frame argument.";
return loadSkyImage( id, filename, azi0, alt0, azi1, alt1, azi2, alt
2, azi3, alt3, minRes, maxBright, visible, StelCore::FrameAltAz);
// NOTE: This old version may have inverted series of coordinates. E
lse, the only difference against the original loadSkyImage (setting J2000 c
oords) is the frame.
/*
if (allSkyLayers.contains(id)) 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 = StelFileMgr::findFile(filename); QString path = StelFileMgr::findFile(filename);
if (path.isEmpty()) if (path.isEmpty())
{ {
qWarning() << "Could not find image" << QDir::toNativeSepara tors(filename); qWarning() << "Could not find image" << QDir::toNativeSepara tors(filename);
return false; return false;
} }
QVariantMap vm; QVariantMap vm;
QVariantList l; //QVariantList l;
QVariantList cl; // coordinates list for adding worldCoords and text ureCoords QVariantList cl; // coordinates list for adding worldCoords and text ureCoords
QVariantList c; // a list for a pair of coordinates QVariantList c; // a list for a pair of coordinates
QVariantList ol; // outer list - we want a structure 3 levels deep.. . QVariantList ol; // outer list - we want a structure 3 levels deep.. .
vm["imageUrl"] = QVariant(path); vm["imageUrl"] = QVariant(path);
vm["maxBrightness"] = QVariant(maxBright); vm["maxBrightness"] = QVariant(maxBright);
vm["minResolution"] = QVariant(minRes); vm["minResolution"] = QVariant(minRes);
vm["shortName"] = QVariant(id); vm["shortName"] = QVariant(id);
// textureCoords (define the ordering of worldCoords) // textureCoords (define the ordering of worldCoords)
cl.clear(); cl.clear();
skipping to change at line 382 skipping to change at line 379
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() << e.what(); qWarning() << e.what();
return false; return false;
} }
*/
} }
void StelSkyLayerMgr::showLayer(const QString& id, bool b) void StelSkyLayerMgr::showLayer(const QString& id, bool b)
{ {
if (allSkyLayers.contains(id)) if (allSkyLayers.contains(id))
{ {
if (allSkyLayers[id]!=NULL) if (allSkyLayers[id]!=NULL)
allSkyLayers[id]->show = b; allSkyLayers[id]->show = b;
} }
} }
 End of changes. 11 change blocks. 
34 lines changed or deleted 34 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/