StelSkyImageTile.cpp   StelSkyImageTile.cpp 
skipping to change at line 47 skipping to change at line 47
{ {
initCtor(); initCtor();
} }
void StelSkyImageTile::initCtor() void StelSkyImageTile::initCtor()
{ {
minResolution = -1; minResolution = -1;
luminance = -1; luminance = -1;
alphaBlend = false; alphaBlend = false;
noTexture = false; noTexture = false;
texFader = NULL; texFader = Q_NULLPTR;
birthJD = -1e10; birthJD = -1e10;
} }
// Constructor // Constructor
StelSkyImageTile::StelSkyImageTile(const QString& url, StelSkyImageTile* pa rent) : MultiLevelJsonBase(parent) StelSkyImageTile::StelSkyImageTile(const QString& url, StelSkyImageTile* pa rent) : MultiLevelJsonBase(parent)
{ {
initCtor(); initCtor();
if (parent!=NULL) if (parent!=Q_NULLPTR)
{ {
luminance = parent->luminance; luminance = parent->luminance;
alphaBlend = parent->alphaBlend; alphaBlend = parent->alphaBlend;
} }
initFromUrl(url); initFromUrl(url);
} }
// Constructor from a map used for JSON files with more than 1 level // Constructor from a map used for JSON files with more than 1 level
StelSkyImageTile::StelSkyImageTile(const QVariantMap& map, StelSkyImageTile * parent) : MultiLevelJsonBase(parent) StelSkyImageTile::StelSkyImageTile(const QVariantMap& map, StelSkyImageTile * parent) : MultiLevelJsonBase(parent)
{ {
initCtor(); initCtor();
if (parent!=NULL) if (parent!=Q_NULLPTR)
{ {
luminance = parent->luminance; luminance = parent->luminance;
alphaBlend = parent->alphaBlend; alphaBlend = parent->alphaBlend;
} }
initFromQVariantMap(map); initFromQVariantMap(map);
} }
// Destructor // Destructor
StelSkyImageTile::~StelSkyImageTile() StelSkyImageTile::~StelSkyImageTile()
{ {
skipping to change at line 116 skipping to change at line 116
// Return the list of tiles which should be drawn. // Return the list of tiles which should be drawn.
void StelSkyImageTile::getTilesToDraw(QMultiMap<double, StelSkyImageTile*>& result, StelCore* core, const SphericalRegionP& viewPortPoly, float limitL uminance, bool recheckIntersect) void StelSkyImageTile::getTilesToDraw(QMultiMap<double, StelSkyImageTile*>& result, StelCore* core, const SphericalRegionP& viewPortPoly, float limitL uminance, bool recheckIntersect)
{ {
#ifndef NDEBUG #ifndef NDEBUG
// When this method is called, we can assume that: // When this method is called, we can assume that:
// - the parent tile min resolution was reached // - the parent tile min resolution was reached
// - the parent tile is intersecting FOV // - the parent tile is intersecting FOV
// - the parent tile is not scheduled for deletion // - the parent tile is not scheduled for deletion
const StelSkyImageTile* parent = qobject_cast<StelSkyImageTile*>(QOb ject::parent()); const StelSkyImageTile* parent = qobject_cast<StelSkyImageTile*>(QOb ject::parent());
if (parent!=NULL) if (parent!=Q_NULLPTR)
{ {
Q_ASSERT(isDeletionScheduled()==false); Q_ASSERT(isDeletionScheduled()==false);
const double degPerPixel = 1./core->getProjection(StelCore:: FrameJ2000)->getPixelPerRadAtCenter()*180./M_PI; const double degPerPixel = 1./core->getProjection(StelCore:: FrameJ2000)->getPixelPerRadAtCenter()*180./M_PI;
Q_ASSERT(degPerPixel<parent->minResolution); Q_ASSERT(degPerPixel<parent->minResolution);
Q_ASSERT(parent->isDeletionScheduled()==false); Q_ASSERT(parent->isDeletionScheduled()==false);
} }
#endif #endif
// An error occured during loading // An error occured during loading
skipping to change at line 336 skipping to change at line 336
extinctedColor[0]*=fabs(extinctionFactor); extinctedColor[0]*=fabs(extinctionFactor);
extinctedColor[1]*=fabs(extinctionFactor); extinctedColor[1]*=fabs(extinctionFactor);
extinctedColor[2]*=fabs(extinctionFactor); extinctedColor[2]*=fabs(extinctionFactor);
} }
sPainter.setColor(extinctedColor[0], extinctedColor[1], exti nctedColor[2], extinctedColor[3]); sPainter.setColor(extinctedColor[0], extinctedColor[1], exti nctedColor[2], extinctedColor[3]);
sPainter.drawSphericalRegion(poly.data(), StelPainter::Spher icalPolygonDrawModeTextureFill); sPainter.drawSphericalRegion(poly.data(), StelPainter::Spher icalPolygonDrawModeTextureFill);
} }
#ifdef DEBUG_STELSKYIMAGE_TILE #ifdef DEBUG_STELSKYIMAGE_TILE
if (debugFont==NULL) if (debugFont==Q_NULLPTR)
{ {
debugFont = &StelApp::getInstance().getFontManager().getStan dardFont(StelApp::getInstance().getLocaleMgr().getSkyLanguage(), 12); debugFont = &StelApp::getInstance().getFontManager().getStan dardFont(StelApp::getInstance().getLocaleMgr().getSkyLanguage(), 12);
} }
color.set(1.0,0.5,0.5,1.0); color.set(1.0,0.5,0.5,1.0);
foreach (const SphericalRegionP& poly, skyConvexPolygons) foreach (const SphericalRegionP& poly, skyConvexPolygons)
{ {
Vec3d win; Vec3d win;
Vec3d bary = poly->getPointInside(); Vec3d bary = poly->getPointInside();
sPainter.getProjector()->project(bary,win); sPainter.getProjector()->project(bary,win);
sPainter.drawText(debugFont, win[0], win[1], getAbsoluteImag eURI()); sPainter.drawText(debugFont, win[0], win[1], getAbsoluteImag eURI());
skipping to change at line 382 skipping to change at line 382
if (map.contains("serverCredits")) if (map.contains("serverCredits"))
{ {
QVariantMap sCredits = map.value("serverCredits").toMap(); QVariantMap sCredits = map.value("serverCredits").toMap();
serverCredits.shortCredits = sCredits.value("short").toStrin g(); serverCredits.shortCredits = sCredits.value("short").toStrin g();
serverCredits.fullCredits = sCredits.value("full").toString( ); serverCredits.fullCredits = sCredits.value("full").toString( );
serverCredits.infoURL = sCredits.value("infoUrl").toString() ; serverCredits.infoURL = sCredits.value("infoUrl").toString() ;
} }
if (map.contains("description")) if (map.contains("description"))
{ {
htmlDescription = map.value("description").toString(); htmlDescription = map.value("description").toString();
if (parent()==NULL) if (parent()==Q_NULLPTR)
{ {
htmlDescription+= "<h3>URL: "+contructorUrl+"</h3>"; htmlDescription+= "<h3>URL: "+contructorUrl+"</h3>";
} }
} }
else else
{ {
if (parent()==NULL) if (parent()==Q_NULLPTR)
{ {
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"))
skipping to change at line 421 skipping to change at line 421
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"))
{ {
// maxBrightness is the maximum nebula brightness in Vmag/ar cmin^2 // maxBrightness is the maximum nebula brightness in Vmag/ar cmin^2
luminance = map.value("maxBrightness").toFloat(&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();
} }
// Load the convex polygons (if any) // Load the convex polygons (if any)
QVariantList polyList = map.value("skyConvexPolygons").toList(); QVariantList polyList = map.value("skyConvexPolygons").toList();
if (polyList.empty()) if (polyList.empty())
 End of changes. 8 change blocks. 
8 lines changed or deleted 8 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/