StelSkyImageTile.cpp   StelSkyImageTile.cpp 
skipping to change at line 76 skipping to change at line 76
alphaBlend = parent->alphaBlend; alphaBlend = parent->alphaBlend;
} }
initFromQVariantMap(map); initFromQVariantMap(map);
} }
// Destructor // Destructor
StelSkyImageTile::~StelSkyImageTile() StelSkyImageTile::~StelSkyImageTile()
{ {
} }
void StelSkyImageTile::draw(StelCore* core, StelPainter& sPainter, float op acity) void StelSkyImageTile::draw(StelCore* core, StelPainter& sPainter, float)
{ {
const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000) ; const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000) ;
const float limitLuminance = core->getSkyDrawer()->getLimitLuminance (); const float limitLuminance = core->getSkyDrawer()->getLimitLuminance ();
QMultiMap<double, StelSkyImageTile*> result; QMultiMap<double, StelSkyImageTile*> result;
getTilesToDraw(result, core, prj->getViewportConvexPolygon(0, 0), li mitLuminance, true); getTilesToDraw(result, core, prj->getViewportConvexPolygon(0, 0), li mitLuminance, true);
int numToBeLoaded=0; int numToBeLoaded=0;
foreach (StelSkyImageTile* t, result) foreach (StelSkyImageTile* t, result)
if (t->isReadyToDisplay()==false) if (t->isReadyToDisplay()==false)
skipping to change at line 337 skipping to change at line 337
htmlDescription= "<h3>URL: "+contructorUrl+"</h3>"; htmlDescription= "<h3>URL: "+contructorUrl+"</h3>";
} }
} }
shortName = map.value("shortName").toString(); shortName = map.value("shortName").toString();
if (shortName.isEmpty()) if (shortName.isEmpty())
shortName = "no name"; shortName = "no name";
bool ok=false; bool ok=false;
if (!map.contains("minResolution")) if (!map.contains("minResolution"))
throw std::runtime_error(qPrintable(QString("minResolution i s mandatory"))); throw std::runtime_error(qPrintable(QString("minResolution i s mandatory")));
minResolution = map.value("minResolution").toDouble(&ok); minResolution = map.value("minResolution").toFloat(&ok);
if (!ok) if (!ok)
{ {
throw std::runtime_error(qPrintable(QString("minResolution e xpect a double value, found: \"%1\"").arg(map.value("minResolution").toStri ng()))); throw std::runtime_error(qPrintable(QString("minResolution e xpect a double value, found: \"%1\"").arg(map.value("minResolution").toStri ng())));
} }
if (map.contains("luminance")) if (map.contains("luminance"))
{ {
luminance = map.value("luminance").toDouble(&ok); luminance = map.value("luminance").toFloat(&ok);
if (!ok) if (!ok)
throw std::runtime_error("luminance expect a float v alue"); throw std::runtime_error("luminance expect a float v alue");
qWarning() << "luminance in preview JSON files is deprecated . Replace with maxBrightness."; qWarning() << "luminance in preview JSON files is deprecated . Replace with maxBrightness.";
} }
if (map.contains("maxBrightness")) if (map.contains("maxBrightness"))
{ {
luminance = map.value("maxBrightness").toDouble(&ok); luminance = map.value("maxBrightness").toFloat(&ok);
if (!ok) if (!ok)
throw std::runtime_error("maxBrightness expect a flo at value"); throw std::runtime_error("maxBrightness expect a flo at value");
luminance = StelApp::getInstance().getCore()->getSkyDrawer() ->surfacebrightnessToLuminance(luminance); luminance = StelApp::getInstance().getCore()->getSkyDrawer() ->surfacebrightnessToLuminance(luminance);
} }
if (map.contains("alphaBlend")) if (map.contains("alphaBlend"))
{ {
alphaBlend = map.value("alphaBlend").toBool(); alphaBlend = map.value("alphaBlend").toBool();
} }
skipping to change at line 384 skipping to change at line 384
throw std::runtime_error("the number of convex polyg ons does not match the number of texture space polygon"); throw std::runtime_error("the number of convex polyg ons does not match the number of texture space polygon");
for (int i=0;i<polyList.size();++i) for (int i=0;i<polyList.size();++i)
{ {
const QVariant& polyRaDec = polyList.at(i); const QVariant& polyRaDec = polyList.at(i);
QVector<Vec3d> vertices; QVector<Vec3d> vertices;
foreach (const QVariant& vRaDec, polyRaDec.toList()) foreach (const QVariant& vRaDec, polyRaDec.toList())
{ {
const QVariantList vl = vRaDec.toList(); const QVariantList vl = vRaDec.toList();
Vec3d v; Vec3d v;
StelUtils::spheToRect(vl.at(0).toDouble(&ok)*M_PI/18 0., vl.at(1).toDouble(&ok)*M_PI/180., v); StelUtils::spheToRect(vl.at(0).toFloat(&ok)*M_PI/180 .f, vl.at(1).toFloat(&ok)*M_PI/180.f, v);
if (!ok) if (!ok)
throw std::runtime_error("wrong Ra and Dec, expect a double value"); throw std::runtime_error("wrong Ra and Dec, expect a double value");
vertices.append(v); vertices.append(v);
} }
Q_ASSERT(vertices.size()==4); Q_ASSERT(vertices.size()==4);
if (!texCoordList.isEmpty()) if (!texCoordList.isEmpty())
{ {
const QVariant& polyXY = texCoordList.at(i); const QVariant& polyXY = texCoordList.at(i);
QVector<Vec2f> texCoords; QVector<Vec2f> texCoords;
foreach (const QVariant& vXY, polyXY.toList()) foreach (const QVariant& vXY, polyXY.toList())
{ {
const QVariantList vl = vXY.toList(); const QVariantList vl = vXY.toList();
texCoords.append(Vec2f(vl.at(0).toDouble(&ok ), vl.at(1).toDouble(&ok))); texCoords.append(Vec2f(vl.at(0).toFloat(&ok) , vl.at(1).toFloat(&ok)));
if (!ok) if (!ok)
throw std::runtime_error("wrong X an d Y, expect a double value"); throw std::runtime_error("wrong X an d Y, expect a double value");
} }
Q_ASSERT(texCoords.size()==4); Q_ASSERT(texCoords.size()==4);
SphericalTexturedConvexPolygon* pol = new SphericalT exturedConvexPolygon(vertices, texCoords); SphericalTexturedConvexPolygon* pol = new SphericalT exturedConvexPolygon(vertices, texCoords);
Q_ASSERT(pol->checkValid()); Q_ASSERT(pol->checkValid());
skyConvexPolygons.append(SphericalRegionP(pol)); skyConvexPolygons.append(SphericalRegionP(pol));
} }
else else
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 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/