Nebula.cpp   Nebula.cpp 
skipping to change at line 47 skipping to change at line 47
float Nebula::circleScale = 1.f; float Nebula::circleScale = 1.f;
float Nebula::hintsBrightness = 0; float Nebula::hintsBrightness = 0;
Vec3f Nebula::labelColor = Vec3f(0.4,0.3,0.5); Vec3f Nebula::labelColor = Vec3f(0.4,0.3,0.5);
Vec3f Nebula::circleColor = Vec3f(0.8,0.8,0.1); Vec3f Nebula::circleColor = Vec3f(0.8,0.8,0.1);
Nebula::NebulaHintTextures::~NebulaHintTextures() Nebula::NebulaHintTextures::~NebulaHintTextures()
{ {
if(!initialized){return;} if(!initialized){return;}
delete texCircle; delete texCircle;
delete texGalaxy;
delete texOpenCluster; delete texOpenCluster;
delete texGlobularCluster; delete texGlobularCluster;
delete texPlanetaryNebula; delete texPlanetaryNebula;
delete texDiffuseNebula;
delete texOpenClusterWithNebulosity;
initialized = false; initialized = false;
} }
void Nebula::NebulaHintTextures::lazyInit(StelRenderer* renderer) void Nebula::NebulaHintTextures::lazyInit(StelRenderer* renderer)
{ {
if(initialized){return;} if(initialized){return;}
texCircle = renderer->createTexture("textures/neb.png"); texCircle = renderer->createTexture("textures/neb.png");
// Load circle texture // Load circle texture
texOpenCluster = renderer->createTexture("textures/ocl.png"); texGalaxy = renderer->createTexture("textures/neb_gal.png")
// Load open cluster marker texture ; // Load ellipse texture
texGlobularCluster = renderer->createTexture("textures/gcl.png"); texOpenCluster = renderer->createTexture("textures/neb_ocl.png")
// Load globular cluster marker texture ; // Load open cluster marker texture
texPlanetaryNebula = renderer->createTexture("textures/pnb.png"); texGlobularCluster = renderer->createTexture("textures/neb_gcl.png")
// Load planetary nebula marker texture ; // Load globular cluster marker texture
texPlanetaryNebula = renderer->createTexture("textures/neb_pnb.png")
; // Load planetary nebula marker texture
texDiffuseNebula = renderer->createTexture("textures/neb_dif.png")
; // Load diffuse nebula marker texture
texOpenClusterWithNebulosity = renderer->createTexture("textures/neb
_ocln.png"); // Load Ocl/Nebula marker texture
initialized = true; initialized = true;
} }
Nebula::Nebula() : Nebula::Nebula() :
M_nb(0), M_nb(0),
NGC_nb(0), NGC_nb(0),
IC_nb(0) IC_nb(0),
C_nb(0)
{ {
nameI18 = ""; nameI18 = "";
angularSize = -1; angularSize = -1;
} }
Nebula::~Nebula() Nebula::~Nebula()
{ {
} }
QString Nebula::getInfoString(const StelCore *core, const InfoStringGroup& flags) const QString Nebula::getInfoString(const StelCore *core, const InfoStringGroup& flags) const
skipping to change at line 104 skipping to change at line 111
if (nameI18!="" && flags&Name) if (nameI18!="" && flags&Name)
oss << " ("; oss << " (";
QStringList catIds; QStringList catIds;
if ((M_nb > 0) && (M_nb < 111)) if ((M_nb > 0) && (M_nb < 111))
catIds << QString("M %1").arg(M_nb); catIds << QString("M %1").arg(M_nb);
if (NGC_nb > 0) if (NGC_nb > 0)
catIds << QString("NGC %1").arg(NGC_nb); catIds << QString("NGC %1").arg(NGC_nb);
if (IC_nb > 0) if (IC_nb > 0)
catIds << QString("IC %1").arg(IC_nb); catIds << QString("IC %1").arg(IC_nb);
if ((C_nb > 0) && (C_nb < 110))
catIds << QString("C %1").arg(C_nb);
oss << catIds.join(" - "); oss << catIds.join(" - ");
if (nameI18!="" && flags&Name) if (nameI18!="" && flags&Name)
oss << ")"; oss << ")";
} }
if ((flags&Name) || (flags&CatalogNumber)) if ((flags&Name) || (flags&CatalogNumber))
oss << "</h2>"; oss << "</h2>";
if (flags&Extra1) if (flags&Extra1)
skipping to change at line 185 skipping to change at line 194
if (lim > 50) lim = 15.f; if (lim > 50) lim = 15.f;
if (lim>maxMagHints) if (lim>maxMagHints)
return; return;
renderer->setBlendMode(BlendMode_Add); renderer->setBlendMode(BlendMode_Add);
float lum = 1.f;//qMin(1,4.f/getOnScreenSize(core))*0.8; float lum = 1.f;//qMin(1,4.f/getOnScreenSize(core))*0.8;
Vec3f col(circleColor[0]*lum*hintsBrightness, circleColor[1]*lum*hin tsBrightness, circleColor[2]*lum*hintsBrightness); Vec3f col(circleColor[0]*lum*hintsBrightness, circleColor[1]*lum*hin tsBrightness, circleColor[2]*lum*hintsBrightness);
if (StelApp::getInstance().getVisionModeNight()) if (StelApp::getInstance().getVisionModeNight())
col = StelUtils::getNightColor(col); col = StelUtils::getNightColor(col);
renderer->setGlobalColor(col[0], col[1], col[2], 1); renderer->setGlobalColor(col[0], col[1], col[2], 1);
if (nType == 1) /*
{ if (nType == NebGx) hintTextures.texGalaxy->bind();
hintTextures.texOpenCluster->bind(); else if (nType == NebOc) hintTextures.texOpenCluster->bind();
} else if (nType == NebGc) hintTextures.texGlobularCluster->bind();
else if (nType == 2) else if (nType == NebN) hintTextures.texDiffuseNebula->bind();
{ else if (nType == NebPn) hintTextures.texPlanetaryNebula->bind();
hintTextures.texGlobularCluster->bind(); else if (nType == NebCn) hintTextures.texOpenClusterWithNebulosity->
} bind();
else if (nType == 4) else hintTextures.texCircle->bind();
{ */
hintTextures.texPlanetaryNebula->bind(); switch (nType) {
} case NebGx:
else hintTextures.texGalaxy->bind();
{ break;
hintTextures.texCircle->bind(); case NebOc:
hintTextures.texOpenCluster->bind();
break;
case NebGc:
hintTextures.texGlobularCluster->bind();
break;
case NebN:
hintTextures.texDiffuseNebula->bind();
break;
case NebPn:
hintTextures.texPlanetaryNebula->bind();
break;
case NebCn:
hintTextures.texOpenClusterWithNebulosity->bind();
break;
default:
hintTextures.texCircle->bind();
} }
renderer->drawTexturedRect(XY[0] - 6, XY[1] - 6, 12, 12); renderer->drawTexturedRect(XY[0] - 6, XY[1] - 6, 12, 12);
} }
void Nebula::drawLabel(StelRenderer* renderer, StelProjectorP projector, fl oat maxMagLabel) void Nebula::drawLabel(StelRenderer* renderer, StelProjectorP projector, fl oat maxMagLabel)
{ {
float lim = mag; float lim = mag;
if (lim > 50) lim = 15.f; if (lim > 50) lim = 15.f;
if (lim>maxMagLabel) if (lim>maxMagLabel)
return; return;
Vec3f col(labelColor[0], labelColor[1], labelColor[2]); Vec3f col(labelColor[0], labelColor[1], labelColor[2]);
if (StelApp::getInstance().getVisionModeNight()) if (StelApp::getInstance().getVisionModeNight())
col = StelUtils::getNightColor(col); col = StelUtils::getNightColor(col);
renderer->setGlobalColor(col[0], col[1], col[2], hintsBrightness); renderer->setGlobalColor(col[0], col[1], col[2], hintsBrightness);
QString str; QString str;
if (nameI18!="") if (!nameI18.isEmpty())
str = getNameI18n(); str = getNameI18n();
else else
{ {
if (M_nb > 0) if (M_nb > 0)
str = QString("M %1").arg(M_nb); str = QString("M %1").arg(M_nb);
else if (C_nb > 0)
str = QString("C %1").arg(C_nb);
else if (NGC_nb > 0) else if (NGC_nb > 0)
str = QString("NGC %1").arg(NGC_nb); str = QString("NGC %1").arg(NGC_nb);
else if (IC_nb > 0) else if (IC_nb > 0)
str = QString("IC %1").arg(IC_nb); str = QString("IC %1").arg(IC_nb);
} }
float size = getAngularSize(NULL) * M_PI / 180.0 * projector->getPix elPerRadAtCenter(); float size = getAngularSize(NULL) * M_PI / 180.0 * projector->getPix elPerRadAtCenter();
float shift = 4.f + size / 1.8f; float shift = 4.f + size / 1.8f;
renderer->drawText(TextParams(XY[0] + shift, XY[1] + shift, str).use Gravity().projector(projector)); renderer->drawText(TextParams(XY[0] + shift, XY[1] + shift, str).use Gravity().projector(projector));
skipping to change at line 254 skipping to change at line 280
{ {
IC_nb = nb; IC_nb = nb;
} }
else else
{ {
NGC_nb = nb; NGC_nb = nb;
} }
StelUtils::spheToRect(ra,dec,XYZ); StelUtils::spheToRect(ra,dec,XYZ);
Q_ASSERT(fabs(XYZ.lengthSquared()-1.)<0.000000001); Q_ASSERT(fabs(XYZ.lengthSquared()-1.)<0.000000001);
nType = (Nebula::NebulaType)type; nType = (Nebula::NebulaType)type;
// GZ: Trace the undefined entries...
//if (type >= 5) {
// qDebug()<< (isIc?"IC" : "NGC") << nb << " type " << type ;
//}
if (type == 5) {
qDebug()<< (isIc?"IC" : "NGC") << nb << " type " << type ;
}
pointRegion = SphericalRegionP(new SphericalPoint(getJ2000Equatorial Pos(NULL))); pointRegion = SphericalRegionP(new SphericalPoint(getJ2000Equatorial Pos(NULL)));
} }
#if 0 #if 0
QFile filess("filess.dat"); QFile filess("filess.dat");
QDataStream out; QDataStream out;
out.setVersion(QDataStream::Qt_4_5); out.setVersion(QDataStream::Qt_4_5);
bool Nebula::readNGC(char *recordstr) bool Nebula::readNGC(char *recordstr)
{ {
int rahr; int rahr;
skipping to change at line 352 skipping to change at line 385
break; break;
case NebGc: case NebGc:
wsType = q_("Globular cluster"); wsType = q_("Globular cluster");
break; break;
case NebN: case NebN:
wsType = q_("Nebula"); wsType = q_("Nebula");
break; break;
case NebPn: case NebPn:
wsType = q_("Planetary nebula"); wsType = q_("Planetary nebula");
break; break;
case NebDn:
wsType = q_("Dark Nebula");
break;
case NebCn: case NebCn:
wsType = q_("Cluster associated with nebulosity"); wsType = q_("Cluster associated with nebulosity");
break; break;
case NebUnknown: case NebUnknown:
wsType = q_("Unknown"); wsType = q_("Unknown");
break; break;
default: default:
wsType = q_("Undocumented type"); wsType = q_("Undocumented type");
break; break;
} }
 End of changes. 10 change blocks. 
25 lines changed or deleted 65 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/