MinorPlanet.cpp   MinorPlanet.cpp 
skipping to change at line 40 skipping to change at line 40
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include <QRegExp> #include <QRegExp>
#include <QDebug> #include <QDebug>
MinorPlanet::MinorPlanet(const QString& englishName, MinorPlanet::MinorPlanet(const QString& englishName,
int flagLighting, int flagLighting,
double radius, double radius,
double oblateness, double oblateness,
Vec3f color, Vec3f halocolor,
float albedo, float albedo,
const QString& atexMapName, const QString& atexMapName,
posFuncType coordFunc, posFuncType coordFunc,
void* auserDataPtr, void* auserDataPtr,
OsculatingFunctType *osculatingFunc, OsculatingFunctType *osculatingFunc,
bool acloseOrbit, bool acloseOrbit,
bool hidden, bool hidden,
const QString &pTypeStr) const QString &pTypeStr)
: Planet (englishName, : Planet (englishName,
flagLighting, flagLighting,
radius, radius,
oblateness, oblateness,
color, halocolor,
albedo, albedo,
atexMapName, atexMapName,
"", "",
coordFunc, coordFunc,
auserDataPtr, auserDataPtr,
osculatingFunc, osculatingFunc,
acloseOrbit, acloseOrbit,
hidden, hidden,
false, //No atmosphere false, //No atmosphere
true, //Halo true, //Halo
pTypeStr) pTypeStr)
{ {
texMapName = atexMapName; texMapName = atexMapName;
lastOrbitJD =0; lastOrbitJDE =0;
deltaJD = StelCore::JD_SECOND; deltaJDE = StelCore::JD_SECOND;
orbitCached = 0; orbitCached = 0;
closeOrbit = acloseOrbit; closeOrbit = acloseOrbit;
semiMajorAxis = 0.; semiMajorAxis = 0.;
eclipticPos=Vec3d(0.,0.,0.); eclipticPos=Vec3d(0.,0.,0.);
rotLocalToParent = Mat4d::identity(); rotLocalToParent = Mat4d::identity();
texMap = StelApp::getInstance().getTextureManager().createTextureThr ead(StelFileMgr::getInstallationDir()+"/textures/"+texMapName, StelTexture: :StelTextureParams(true, GL_LINEAR, GL_REPEAT)); texMap = StelApp::getInstance().getTextureManager().createTextureThr ead(StelFileMgr::getInstallationDir()+"/textures/"+texMapName, StelTexture: :StelTextureParams(true, GL_LINEAR, GL_REPEAT));
//MinorPlanet specific members //MinorPlanet specific members
minorPlanetNumber = 0; minorPlanetNumber = 0;
skipping to change at line 146 skipping to change at line 146
MinorPlanet::~MinorPlanet() MinorPlanet::~MinorPlanet()
{ {
//Do nothing for the moment //Do nothing for the moment
} }
void MinorPlanet::setSemiMajorAxis(double value) void MinorPlanet::setSemiMajorAxis(double value)
{ {
semiMajorAxis = value; semiMajorAxis = value;
// GZ: in case we have very many asteroids, this helps improving spe ed usually without sacrificing accuracy: // GZ: in case we have very many asteroids, this helps improving spe ed usually without sacrificing accuracy:
deltaJD = 2.0*semiMajorAxis*StelCore::JD_SECOND; deltaJDE = 2.0*semiMajorAxis*StelCore::JD_SECOND;
} }
void MinorPlanet::setMinorPlanetNumber(int number) void MinorPlanet::setMinorPlanetNumber(int number)
{ {
if (minorPlanetNumber) if (minorPlanetNumber)
return; return;
minorPlanetNumber = number; minorPlanetNumber = number;
} }
skipping to change at line 184 skipping to change at line 184
//TODO: This feature has to be implemented better, anyway. //TODO: This feature has to be implemented better, anyway.
provisionalDesignationHtml = renderProvisionalDesignationinHtml(desi gnation); provisionalDesignationHtml = renderProvisionalDesignationinHtml(desi gnation);
} }
QString MinorPlanet::getInfoString(const StelCore *core, const InfoStringGr oup &flags) const QString MinorPlanet::getInfoString(const StelCore *core, const InfoStringGr oup &flags) const
{ {
//Mostly copied from Planet::getInfoString(): //Mostly copied from Planet::getInfoString():
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
double az_app, alt_app;
StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core));
Q_UNUSED(az_app);
if (flags&Name) if (flags&Name)
{ {
oss << "<h2>"; oss << "<h2>";
if (minorPlanetNumber) if (minorPlanetNumber)
oss << QString("(%1) ").arg(minorPlanetNumber); oss << QString("(%1) ").arg(minorPlanetNumber);
if (nameIsProvisionalDesignation) if (nameIsProvisionalDesignation)
oss << provisionalDesignationHtml; oss << provisionalDesignationHtml;
else else
oss << getNameI18n(); // UI translation can differ from sky translation oss << getNameI18n(); // UI translation can differ from sky translation
skipping to change at line 213 skipping to change at line 216
} }
} }
if (flags&ObjectType && getPlanetType()!=isUNDEFINED) if (flags&ObjectType && getPlanetType()!=isUNDEFINED)
{ {
oss << q_("Type: <b>%1</b>").arg(q_(getPlanetTypeString())) << "<br />"; oss << q_("Type: <b>%1</b>").arg(q_(getPlanetTypeString())) << "<br />";
} }
if (flags&Magnitude) if (flags&Magnitude)
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere()) if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app>-3. 0*M_PI/180.0)) // Don't show extincted magnitude much below horizon where m odel is meaningless.
oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2</b>)"). arg(QString::number(getVMagnitude(core), 'f', 2), 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>"; QString::number(getVMagnitudeWithExtinction(core), 'f', 2)) << "<br>";
else else
oss << q_("Magnitude: <b>%1</b>").arg(getVMagnitude(core), 0 , 'f', 2) << "<br>"; oss << q_("Magnitude: <b>%1</b>").arg(getVMagnitude(core), 0 , 'f', 2) << "<br>";
} }
if (flags&AbsoluteMagnitude) if (flags&AbsoluteMagnitude)
{ {
//TODO: Make sure absolute magnitude is a sane value //TODO: Make sure absolute magnitude is a sane value
 End of changes. 6 change blocks. 
6 lines changed or deleted 9 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/