Esempio n. 1
0
void Scenery3d::setEnableBumps(const bool enableBumps)
{
	if(enableBumps != getEnableBumps())
	{
		showMessage(QString(q_("Surface bumps %1.")).arg(enableBumps? qc_("on","enable") : qc_("off","disable")));
		renderer->setBumpsEnabled(enableBumps);

		conf->setValue(S3D_CONFIG_PREFIX + "/flag_bumpmap", enableBumps);
		emit enableBumpsChanged(enableBumps);
	}
}
Esempio n. 2
0
void Scenery3d::setEnablePixelLighting(const bool val)
{
	if(val != getEnablePixelLighting())
	{
		if(!val)
		{
			setEnableBumps(false);
			setEnableShadows(false);
		}
		showMessage(QString(q_("Per-Pixel shading %1.")).arg(val? qc_("on","enable") : qc_("off","disable")));

		renderer->setPixelLightingEnabled(val);
		conf->setValue(S3D_CONFIG_PREFIX + "/flag_pixel_lighting", val);
		emit enablePixelLightingChanged(val);
	}
}
Esempio n. 3
0
void Scenery3d::setEnableShadows(const bool enableShadows)
{
	if(enableShadows != getEnableShadows())
	{
		if (renderer->getShadowmapSize() && getEnablePixelLighting())
		{
			showMessage(QString(q_("Shadows %1.")).arg(enableShadows? qc_("on","enable") : qc_("off","disable")));
			renderer->setShadowsEnabled(enableShadows);
			emit enableShadowsChanged(enableShadows);
		} else
		{
			showMessage(QString(q_("Shadows deactivated or not possible.")));
			renderer->setShadowsEnabled(false);
			emit enableShadowsChanged(false);
		}

		conf->setValue(S3D_CONFIG_PREFIX + "/flag_shadow",getEnableShadows());
	}
}
Esempio n. 4
0
QString Nebula::getHIIBrightnessTypeString() const
{
	QString wsType;

	switch(brightnessType)
	{
		case Faintest:
			wsType = qc_("faintest", "HII region brightness");
			break;
		case Moderate:
			wsType = qc_("moderate", "HII region brightness");
			break;
		case Brightest:
			wsType = qc_("brightest", "HII region brightness");
			break;
		default:
			wsType = q_("undocumented brightness");
			break;
	}
	return wsType;
}
Esempio n. 5
0
QString Nebula::getHIIStructureTypeString() const
{
	QString wsType;

	switch(structureType)
	{
		case StructureAmo:
			wsType = qc_("amorphous","structure");
			break;
		case StructureCon:
			wsType = qc_("conventional","structure");
			break;
		case StructureFil:
			wsType = qc_("filamentary","structure");
			break;
		default:
			wsType = qc_("undocumented structure","structure");
			break;
	}
	return wsType;
}
Esempio n. 6
0
QString Nebula::getHIIFormTypeString() const
{
	QString wsType;

	switch(formType)
	{
		case FormCir:
			wsType = qc_("circular","form");
			break;
		case FormEll:
			wsType = qc_("elliptical","form");
			break;
		case FormIrr:
			wsType = qc_("irregular","form");
			break;
		default:
			wsType = qc_("undocumented form","form");
			break;
	}
	return wsType;
}
void SearchDialog::populateCoordinateSystemsList()
{
	Q_ASSERT(ui->coordinateSystemComboBox);

	QComboBox* csys = ui->coordinateSystemComboBox;

	//Save the current selection to be restored later
	csys->blockSignals(true);
	int index = csys->currentIndex();
	QVariant selectedSystemId = csys->itemData(index);
	csys->clear();
	//For each coordinate system, display the localized name and store the key as user
	//data. Unfortunately, there's no other way to do this than with a cycle.
	csys->addItem(qc_("Equatorial (J2000.0)", "coordinate system"), "equatorialJ2000");
	csys->addItem(qc_("Equatorial", "coordinate system"), "equatorial");
	csys->addItem(qc_("Horizontal", "coordinate system"), "horizontal");
	csys->addItem(qc_("Galactic", "coordinate system"), "galactic");
	csys->addItem(qc_("Ecliptic", "coordinate system"), "ecliptic");
	csys->addItem(qc_("Ecliptic (J2000.0)", "coordinate system"), "eclipticJ2000");

	//Restore the selection
	index = csys->findData(selectedSystemId, Qt::UserRole, Qt::MatchCaseSensitive);
	csys->setCurrentIndex(index);
	csys->blockSignals(false);
}
Esempio n. 8
0
QString Nebula::getHaBrightnessTypeString() const
{
	QString wsType;

	switch(rcwBrightnessType)
	{
		case HaVeryBright:
			wsType = qc_("very bright", "H-α emission region brightness");
			break;
		case HaBright:
			wsType = qc_("bright", "H-α emission region brightness");
			break;
		case HaMedium:
			wsType = qc_("medium", "H-α emission region brightness");
			break;
		case HaFaint:
			wsType = qc_("faint", "H-α emission region brightness");
			break;
		default:
			wsType = q_("undocumented brightness");
			break;
	}
	return wsType;
}
Esempio n. 9
0
void ExoplanetsDialog::populateTemperatureScales()
{
	Q_ASSERT(ui->temperatureScaleComboBox);

	QComboBox* tscale = ui->temperatureScaleComboBox;

	//Save the current selection to be restored later
	tscale->blockSignals(true);
	int index = tscale->currentIndex();
	QVariant selectedTScaleId = tscale->itemData(index);
	tscale->clear();

	// TRANSLATORS: Name of temperature scale
	tscale->addItem(qc_("Kelvin", "temperature scale"), "Kelvin");
	// TRANSLATORS: Name of temperature scale
	tscale->addItem(qc_("Celsius", "temperature scale"), "Celsius");
	// TRANSLATORS: Name of temperature scale
	tscale->addItem(qc_("Fahrenheit", "temperature scale"), "Fahrenheit");

	//Restore the selection
	index = tscale->findData(selectedTScaleId, Qt::UserRole, Qt::MatchCaseSensitive);
	tscale->setCurrentIndex(index);
	tscale->blockSignals(false);
}
Esempio n. 10
0
QString Nova::getInfoString(const StelCore* core, const InfoStringGroup& flags) const
{
	QString str;
	QTextStream oss(&str);

	if (flags&Name)
	{
		QString name = novaName.isEmpty() ? QString("<h2>%1</h2>").arg(designation) : QString("<h2>%1 (%2)</h2>").arg(getNameI18n()).arg(designation);
		oss << name;
	}

	if (flags&ObjectType)
		oss << QString("%1: <b>%2</b> (%3)").arg(q_("Type"), q_("nova"), novaType) << "<br />";

	if (flags&Magnitude)
	{
		double az_app, alt_app;
		StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core));
		Q_UNUSED(az_app);
		oss << getMagnitudeInfoString(core, flags, alt_app, 2);
	}

	// Ra/Dec etc.
	oss << getCommonInfoString(core, flags);

	if (flags&Extra)
	{
		oss << QString("%1: %2").arg(q_("Maximum brightness"), getMaxBrightnessDate(peakJD)) << "<br />";
		if (distance>0)
		{
			//TRANSLATORS: Unit of measure for distance - Light Years
			QString ly = qc_("ly", "distance");
			oss << QString("%1: %2 %3").arg(q_("Distance"), QString::number(distance*1000, 'f', 2), ly) << "<br />";
		}
	}

	postProcessInfoString(str, flags);
	return str;
}
Esempio n. 11
0
void PointerCoordinates::draw(StelCore *core)
{
	if (!isEnabled())
		return;

	const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000, StelCore::RefractionAuto);
	StelPainter sPainter(prj);
	sPainter.setColor(textColor[0], textColor[1], textColor[2], 1.f);
	font.setPixelSize(getFontSize());
	sPainter.setFont(font);

	QPoint p = StelMainView::getInstance().getMousePos(); // get screen coordinates of mouse cursor
	Vec3d mousePosition;
	float wh = prj->getViewportWidth()/2.; // get half of width of the screen
	float hh = prj->getViewportHeight()/2.; // get half of height of the screen
	float mx = p.x()-wh; // point 0 in center of the screen, axis X directed to right
	float my = p.y()-hh; // point 0 in center of the screen, axis Y directed to bottom
	// calculate position of mouse cursor via position of center of the screen (and invert axis Y)
	// If coordinates are invalid, don't draw them.
	bool coordsValid=false;
	coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx, prj->getViewportPosY()+hh+1-my, mousePosition);
	{ // Nick Fedoseev patch
		Vec3d win;
		prj->project(mousePosition,win);
		float dx = prj->getViewportPosX()+wh+mx - win.v[0];
		float dy = prj->getViewportPosY()+hh+1-my - win.v[1];
		coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx+dx, prj->getViewportPosY()+hh+1-my+dy, mousePosition);
	}
	if (!coordsValid)
		return;

	bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDegrees();
	bool useSouthAzimuth = StelApp::getInstance().getFlagSouthAzimuthUsage();

	QString coordsSystem, cxt, cyt;
	double cx, cy;
	switch (getCurrentCoordinateSystem())
	{
		case RaDecJ2000:
		{
			StelUtils::rectToSphe(&cx,&cy,mousePosition); // Calculate RA/DE (J2000.0) and show it...
			coordsSystem = qc_("RA/Dec (J2000.0)", "abbreviated in the plugin");
			if (withDecimalDegree)
			{
				cxt = StelUtils::radToDecDegStr(cx, 5, false, true);
				cyt = StelUtils::radToDecDegStr(cy);
			}
			else
			{
				cxt = StelUtils::radToHmsStr(cx, true);
				cyt = StelUtils::radToDmsStr(cy, true);
			}
			break;
		}
		case RaDec:
		{
			StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEqu(mousePosition)); // Calculate RA/DE and show it...
			coordsSystem = qc_("RA/Dec", "abbreviated in the plugin");
			if (withDecimalDegree)
			{
				cxt = StelUtils::radToDecDegStr(cx, 5, false, true);
				cyt = StelUtils::radToDecDegStr(cy);
			}
			else
			{
				cxt = StelUtils::radToHmsStr(cx, true);
				cyt = StelUtils::radToDmsStr(cy, true);
			}
			break;
		}
		case AltAzi:
		{
			StelUtils::rectToSphe(&cy,&cx,core->j2000ToAltAz(mousePosition, StelCore::RefractionAuto));
			float direction = 3.; // N is zero, E is 90 degrees
			if (useSouthAzimuth)
				direction = 2.;
			cy = direction*M_PI - cy;
			if (cy > M_PI*2)
				cy -= M_PI*2;

			coordsSystem = qc_("Az/Alt", "abbreviated in the plugin");
			if (withDecimalDegree)
			{
				cxt = StelUtils::radToDecDegStr(cy);
				cyt = StelUtils::radToDecDegStr(cx);
			}
			else
			{
				cxt = StelUtils::radToDmsStr(cy);
				cyt = StelUtils::radToDmsStr(cx);
			}
			break;
		}
		case Galactic:
		{
			StelUtils::rectToSphe(&cx,&cy,core->j2000ToGalactic(mousePosition)); // Calculate galactic position and show it...
			coordsSystem = qc_("Gal. Long/Lat", "abbreviated in the plugin");
			if (withDecimalDegree)
			{
				cxt = StelUtils::radToDecDegStr(cx);
				cyt = StelUtils::radToDecDegStr(cy);
			}
			else
			{
				cxt = StelUtils::radToDmsStr(cx, true);
				cyt = StelUtils::radToDmsStr(cy, true);
			}
			break;
		}
		case Ecliptic:
		{
			double lambda, beta;
			StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEqu(mousePosition));
			StelUtils::equToEcl(cx, cy, core->getCurrentPlanet()->getRotObliquity(core->getJDE()), &lambda, &beta); // Calculate ecliptic position and show it...
			if (lambda<0) lambda+=2.0*M_PI;
			coordsSystem = qc_("Ecl. Long/Lat", "abbreviated in the plugin");
			if (withDecimalDegree)
			{
				cxt = StelUtils::radToDecDegStr(lambda);
				cyt = StelUtils::radToDecDegStr(beta);
			}
			else
			{
				cxt = StelUtils::radToDmsStr(lambda, true);
				cyt = StelUtils::radToDmsStr(beta, true);
			}
			break;
		}
		case EclipticJ2000:
		{
			double lambda, beta;
			StelUtils::rectToSphe(&cx,&cy, mousePosition);
			StelUtils::equToEcl(cx, cy, core->getCurrentPlanet()->getRotObliquity(2451545.0), &lambda, &beta); // Calculate ecliptic position and show it...
			if (lambda<0) lambda+=2.0*M_PI;
			coordsSystem = qc_("Ecl. Long/Lat (J2000.0)", "abbreviated in the plugin");
			if (withDecimalDegree)
			{
				cxt = StelUtils::radToDecDegStr(lambda);
				cyt = StelUtils::radToDecDegStr(beta);
			}
			else
			{
				cxt = StelUtils::radToDmsStr(lambda, true);
				cyt = StelUtils::radToDmsStr(beta, true);
			}
			break;
		}
		case HourAngle:
		{
			Vec3d v = core->j2000ToAltAz(mousePosition, StelCore::RefractionAuto);
			StelUtils::rectToSphe(&cx,&cy,Mat4d::zrotation(-core->getLocalSiderealTime())*core->altAzToEquinoxEqu(v, StelCore::RefractionOff));
			cx = 2.*M_PI-cx;
			coordsSystem = qc_("HA/Dec", "abbreviated in the plugin");
			if (withDecimalDegree)
			{
				double ha_sidereal = cx*12/M_PI;
				if (ha_sidereal>24.)
					ha_sidereal -= 24.;
				cxt = QString("%1h").arg(ha_sidereal, 0, 'f', 5);
				cyt = StelUtils::radToDecDegStr(cy);

			}
			else
			{
				cxt = StelUtils::radToHmsStr(cx);
				cyt = StelUtils::radToDmsStr(cy);
			}
			break;		
		}
	}

	QString coordsText = QString("%1: %2/%3").arg(coordsSystem).arg(cxt).arg(cyt);
	sPainter.drawText(getCoordinatesPlace(coordsText).first, getCoordinatesPlace(coordsText).second, coordsText);
}
Esempio n. 12
0
void SupernovaeDialog::refreshUpdateValues(void)
{
	QString nextUpdate = q_("Next update");
	ui->lastUpdateDateTimeEdit->setDateTime(sn->getLastUpdate());
	ui->updateFrequencySpinBox->setValue(sn->getUpdateFrequencyDays());
	int secondsToUpdate = sn->getSecondsToUpdate();
	ui->internetUpdatesCheckbox->setChecked(sn->getUpdatesEnabled());
	if (!sn->getUpdatesEnabled())
		ui->nextUpdateLabel->setText(q_("Internet updates disabled"));
	else if (sn->getUpdateState() == Supernovae::Updating)
		ui->nextUpdateLabel->setText(q_("Updating now..."));
	else if (secondsToUpdate <= 60)
		ui->nextUpdateLabel->setText(QString("%1: %2").arg(nextUpdate, q_("< 1 minute")));
	else if (secondsToUpdate < 3600)
	{
		int n = (secondsToUpdate/60)+1;
		// TRANSLATORS: minutes.
		ui->nextUpdateLabel->setText(QString("%1: %2 %3").arg(nextUpdate, QString::number(n), qc_("m", "time")));
	}
	else if (secondsToUpdate < 86400)
	{
		int n = (secondsToUpdate/3600)+1;
		// TRANSLATORS: hours.
		ui->nextUpdateLabel->setText(QString("%1: %2 %3").arg(nextUpdate, QString::number(n), qc_("h", "time")));
	}
	else
	{
		int n = (secondsToUpdate/86400)+1;
		// TRANSLATORS: days.
		ui->nextUpdateLabel->setText(QString("%1: %2 %3").arg(nextUpdate, QString::number(n), qc_("d", "time")));
	}
}
Esempio n. 13
0
QString Exoplanet::getInfoString(const StelCore* core, const InfoStringGroup& flags) const
{
	QString str;
	QTextStream oss(&str);
	const StelTranslator& trans = StelApp::getInstance().getLocaleMgr().getSkyTranslator();

	if (flags&Name)
	{
		QString systemName = getNameI18n();
		if (!starProperName.isEmpty())
			systemName.append(QString(" (%1)").arg(designation));

		oss << "<h2>" << systemName << "</h2>";
	}
	
	if (flags&ObjectType)
	{
		oss << QString("%1: <b>%2</b>").arg(q_("Type"), q_("planetary system")) << "<br />";
	}

	if (flags&Magnitude && Vmag<99 && !distributionMode)
	{
		double az_app, alt_app;
		StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core));
		Q_UNUSED(az_app);

		oss << getMagnitudeInfoString(core, flags, alt_app, 2);
	}

	// Ra/Dec etc.
	oss << getCommonInfoString(core, flags);

	if (flags&Extra && !stype.isEmpty())
		oss <<  QString("%1: <b>%2</b>").arg(q_("Spectral Type"), stype) << "<br />";

	if (flags&Distance && distance>0)
	{
		//TRANSLATORS: Unit of measure for distance - Light Years
		QString ly = qc_("ly", "distance");
		oss << QString("%1: %2 %3").arg(q_("Distance"), QString::number(distance/0.306601, 'f', 2), ly) << "<br />";
	}

	if (flags&Extra)
	{
		if (smetal!=0)
		{
			oss << QString("%1 [Fe/H]: %2").arg(q_("Metallicity"), QString::number(smetal, 'f', 3)) << "<br />";
		}
		if (smass>0)
		{
			oss << QString("%1: %2 M<sub>%3</sub>").arg(q_("Mass"), QString::number(smass, 'f', 3), q_("Sun")) << "<br />";
		}
		if (sradius>0)
		{
			oss << QString("%1: %2 R<sub>%3</sub>").arg(q_("Radius"), QString::number(sradius, 'f', 5), q_("Sun")) << "<br />";
		}
		if (effectiveTemp>0)
		{
			oss << QString("%1: %2 %3").arg(q_("Effective temperature")).arg(effectiveTemp).arg(qc_("K", "temperature")) << "<br />";
		}
		if (exoplanets.size() > 0)
		{
			QString qss = "padding: 0 2px 0 0;";
			QString planetNameLabel = QString("<td style=\"%2\">%1</td>").arg(q_("Exoplanet")).arg(qss);
			QString planetProperNameLabel = QString("<td style=\"%2\">%1</td>").arg(q_("Name")).arg(qss);
			QString periodLabel = QString("<td style=\"%3\">%1 (%2)</td>").arg(q_("Period")).arg(qc_("days", "period")).arg(qss);
			QString massLabel = QString("<td style=\"%3\">%1 (M<sub>%2</sub>)</td>").arg(q_("Mass")).arg(q_("Jup")).arg(qss);
			QString radiusLabel = QString("<td style=\"%3\">%1 (R<sub>%2</sub>)</td>").arg(q_("Radius")).arg(q_("Jup")).arg(qss);
			QString semiAxisLabel = QString("<td style=\"%3\">%1 (%2)</td>").arg(q_("Semi-Major Axis")).arg(qc_("AU", "distance, astronomical unit")).arg(qss);
			QString eccentricityLabel = QString("<td style=\"%2\">%1</td>").arg(q_("Eccentricity")).arg(qss);
			QString inclinationLabel = QString("<td style=\"%3\">%1 (%2)</td>").arg(q_("Inclination")).arg(QChar(0x00B0)).arg(qss);
			QString angleDistanceLabel = QString("<td style=\"%2\">%1 (\")</td>").arg(q_("Angle Distance")).arg(qss);
			QString discoveredLabel = QString("<td style=\"%2\">%1</td>").arg(q_("Discovered year")).arg(qss);
			QString detectionMethodLabel = QString("<td style=\"%2\">%1</td>").arg(q_("Detection method")).arg(qss);
			QString pClassLabel = QString("<td style=\"%2\">%1</td>").arg(q_("Planetary class")).arg(qss);
			//TRANSLATORS: Full phrase is "Equilibrium Temperature"
			QString equilibriumTempLabel = QString("<td style=\"%3\">%1 (%2)</td>").arg(q_("Equilibrium temp.")).arg(getTemperatureScaleUnit()).arg(qss);
			//TRANSLATORS: Average stellar flux of the planet
			QString fluxLabel = QString("<td style=\"%2\">%1 (S<sub>E</sub>)</td>").arg(q_("Flux")).arg(qss);
			//TRANSLATORS: ESI = Earth Similarity Index
			QString ESILabel = QString("<td style=\"%2\">%1</td>").arg(q_("ESI")).arg(qss);

			QString row = "<td style=\"padding:0 2px;\">%1</td>";
			QString emRow = "<td style=\"padding:0 2px;\"><em>%1</em></td>";
			QString emptyRow = "<td style=\"padding:0 2px;\">&mdash;</td>";
			for (const auto& p : exoplanets)
			{
				if (!p.planetName.isEmpty())
					planetNameLabel.append(row.arg(p.planetName));
				else
					planetNameLabel.append(emptyRow);

				if (!p.planetProperName.isEmpty())
					planetProperNameLabel.append(row.arg(trans.qtranslate(p.planetProperName)));
				else
					planetProperNameLabel.append(emptyRow);

				if (p.period > -1.f)
					periodLabel.append(row.arg(QString::number(p.period, 'f', 2)));
				else
					periodLabel.append(emptyRow);

				if (p.mass > -1.f)
					massLabel.append(row.arg(QString::number(p.mass, 'f', 2)));
				else
					massLabel.append(emptyRow);

				if (p.radius > -1.f)
					radiusLabel.append(row.arg(QString::number(p.radius, 'f', 1)));
				else
					radiusLabel.append(emptyRow);

				if (p.eccentricity > -1.f)
					eccentricityLabel.append(row.arg(QString::number(p.eccentricity, 'f', 3)));
				else
					eccentricityLabel.append(emptyRow);

				if (p.inclination > -1.f)
					inclinationLabel.append(row.arg(QString::number(p.inclination, 'f', 1)));
				else
					inclinationLabel.append(emptyRow);

				if (p.semiAxis > -1.f)
					semiAxisLabel.append(row.arg(QString::number(p.semiAxis, 'f', 4)));
				else
					semiAxisLabel.append(emptyRow);

				if (p.angleDistance > -1.f)
					angleDistanceLabel.append(row.arg(QString::number(p.angleDistance, 'f', 6)));
				else
					angleDistanceLabel.append(emptyRow);

				if (p.discovered > 0)
					discoveredLabel.append(row.arg(QString::number(p.discovered)));
				else
					discoveredLabel.append(emptyRow);

				if (!p.pclass.isEmpty())
				{
					if (!p.conservative)
						pClassLabel.append(emRow.arg(getPlanetaryClassI18n(p.pclass)));
					else
						pClassLabel.append(row.arg(getPlanetaryClassI18n(p.pclass)));
				}
				else
					pClassLabel.append(emptyRow);

				if (p.EqTemp > 0)
				{
					if (!p.conservative)
						equilibriumTempLabel.append(emRow.arg(QString::number(getTemperature(p.EqTemp), 'f', 2)));
					else
						equilibriumTempLabel.append(row.arg(QString::number(getTemperature(p.EqTemp), 'f', 2)));
				}
				else
					equilibriumTempLabel.append(emptyRow);

				if (p.flux > 0)
				{
					if (!p.conservative)
						fluxLabel.append(emRow.arg(QString::number(p.flux * 0.01, 'f', 2)));
					else
						fluxLabel.append(row.arg(QString::number(p.flux * 0.01, 'f', 2)));
				}
				else
					fluxLabel.append(emptyRow);

				if (p.ESI > 0)
				{
					if (!p.conservative)
						ESILabel.append(emRow.arg(QString::number(p.ESI * 0.01, 'f', 2)));
					else
						ESILabel.append(row.arg(QString::number(p.ESI * 0.01, 'f', 2)));
				}
				else
					ESILabel.append(emptyRow);

				if (p.detectionMethod.isEmpty())
					detectionMethodLabel.append(emptyRow);
				else
					detectionMethodLabel.append(row.arg(q_(p.detectionMethod)));
			}
			oss << "<table style='margin-left: -2px;'>"; // Cosmetic fix
			oss << "<tr>" << planetNameLabel << "</tr>";
			oss << "<tr>" << planetProperNameLabel << "</tr>";
			oss << "<tr>" << periodLabel << "</tr>";
			oss << "<tr>" << massLabel << "</tr>";
			oss << "<tr>" << radiusLabel << "</tr>";
			oss << "<tr>" << semiAxisLabel << "</tr>";
			oss << "<tr>" << eccentricityLabel << "</tr>";
			oss << "<tr>" << inclinationLabel << "</tr>";
			oss << "<tr>" << angleDistanceLabel << "</tr>";
			oss << "<tr>" << discoveredLabel << "</tr>";
			oss << "<tr>" << detectionMethodLabel << "</tr>";
			if (hasHabitableExoplanets)
			{
				oss << "<tr>" << pClassLabel << "</tr>";
				oss << "<tr>" << equilibriumTempLabel << "</tr>";
				oss << "<tr>" << fluxLabel << "</tr>";
				oss << "<tr>" << ESILabel << "</tr>";
			}
			oss << "</table>";
			if (hasHabitableExoplanets)
				oss << QString("%1: %2%3").arg(q_("Equilibrium temperature on Earth")).arg(QString::number(getTemperature(255), 'f', 2)).arg(getTemperatureScaleUnit()) << "<br />";
		}
	}

	postProcessInfoString(str, flags);
	return str;
}
Esempio n. 14
0
QString Nebula::getInfoString(const StelCore *core, const InfoStringGroup& flags) const
{
	QString str;
	QTextStream oss(&str);

	if ((flags&Name) || (flags&CatalogNumber))
		oss << "<h2>";

	if (nameI18!="" && flags&Name)
	{
		oss << getNameI18n();
	}

	if (flags&CatalogNumber)
	{
		if (nameI18!="" && flags&Name)
			oss << " (";

		QStringList catIds;
		if ((M_nb > 0) && (M_nb < 111))
			catIds << QString("M %1").arg(M_nb);
		if ((C_nb > 0) && (C_nb < 110))
			catIds << QString("C %1").arg(C_nb);
		if (NGC_nb > 0)
			catIds << QString("NGC %1").arg(NGC_nb);
		if (IC_nb > 0)
			catIds << QString("IC %1").arg(IC_nb);		
		if ((B_nb > 0) && (B_nb <= 370))
			catIds << QString("B %1").arg(B_nb);
		if ((Sh2_nb > 0) && (Sh2_nb <= 313))
			catIds << QString("Sh 2-%1").arg(Sh2_nb);
		if ((VdB_nb > 0) && (VdB_nb <= 158))
			catIds << QString("VdB %1").arg(VdB_nb);
		if ((RCW_nb > 0) && (RCW_nb <= 182))
			catIds << QString("RCW %1").arg(RCW_nb);
		if ((LDN_nb > 0) && (LDN_nb <= 1802))
			catIds << QString("LDN %1").arg(LDN_nb);
		if ((LBN_nb > 0) && (LBN_nb <= 1125))
			catIds << QString("LBN %1").arg(LBN_nb);
		if ((Cr_nb > 0) && (Cr_nb <= 471))
			catIds << QString("Cr %1").arg(Cr_nb);
		if ((Mel_nb > 0) && (Mel_nb <= 245))
			catIds << QString("Mel %1").arg(Mel_nb);
		oss << catIds.join(" - ");

		if (nameI18!="" && flags&Name)
			oss << ")";
	}

	if ((flags&Name) || (flags&CatalogNumber))
		oss << "</h2>";

	if (flags&ObjectType)
		oss << q_("Type: <b>%1</b>").arg(getTypeString()) << "<br>";

	if (mag < 50 && flags&Magnitude)
	{
		if (nType == NebDn)
		{
			oss << q_("Opacity: <b>%1</b>").arg(getVMagnitude(core), 0, 'f', 2) << "<br>";
		}
		else
		{
			if (core->getSkyDrawer()->getFlagHasAtmosphere())
				oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2</b>)").arg(QString::number(getVMagnitude(core), 'f', 2),
												QString::number(getVMagnitudeWithExtinction(core), 'f', 2)) << "<br>";
			else
				oss << q_("Magnitude: <b>%1</b>").arg(getVMagnitude(core), 0, 'f', 2) << "<br>";
		}
	}
	if (nType != NebDn && mag < 50 && flags&Extra)
	{
		if (core->getSkyDrawer()->getFlagHasAtmosphere())
		{
			if (getSurfaceBrightness(core)<99 && getSurfaceBrightnessWithExtinction(core)<99)
				oss << q_("Surface brightness: <b>%1</b> (extincted to: <b>%2</b>)").arg(QString::number(getSurfaceBrightness(core), 'f', 2),
													 QString::number(getSurfaceBrightnessWithExtinction(core), 'f', 2)) << "<br>";
		}
		else
		{
			if (getSurfaceBrightness(core)<99)
				oss << q_("Surface brightness: <b>%1</b>").arg(QString::number(getSurfaceBrightness(core), 'f', 2)) << "<br>";
		}
	}
	if (flags&Extra)
	{
		if (nType==NebHII)
		{
			if (LBN_nb!=0)
				oss << q_("Brightness: %1").arg(brightnessClass) << "<br>";
			else
			{
				oss << qc_("Form: %1","HII Region").arg(getHIIFormTypeString()) << "<br>";
				oss << qc_("Structure: %1","HII Region").arg(getHIIStructureTypeString()) << "<br>";
				oss << q_("Brightness: %1").arg(getHIIBrightnessTypeString()) << "<br>";
			}
		}
		if (nType==NebHa)
		{
			oss << q_("Brightness: %1").arg(getHaBrightnessTypeString()) << "<br>";
		}
	}
	oss << getPositionInfoString(core, flags);

	if (angularSize>0 && flags&Size)
		oss << q_("Size: %1").arg(StelUtils::radToDmsStr(angularSize*M_PI/180.)) << "<br>";

	postProcessInfoString(str, flags);

	return str;
}