StelObject.cpp   StelObject.cpp 
skipping to change at line 17 skipping to change at line 17
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "RefractionExtinction.hpp" #include "RefractionExtinction.hpp"
skipping to change at line 69 skipping to change at line 69
{ {
return core->j2000ToAltAz(getJ2000EquatorialPos(core), StelCore::Ref ractionOn); return core->j2000ToAltAz(getJ2000EquatorialPos(core), StelCore::Ref ractionOn);
} }
// Get observer-centered alt/az position // Get observer-centered alt/az position
Vec3d StelObject::getAltAzPosAuto(const StelCore* core) const Vec3d StelObject::getAltAzPosAuto(const StelCore* core) const
{ {
return core->j2000ToAltAz(getJ2000EquatorialPos(core)); return core->j2000ToAltAz(getJ2000EquatorialPos(core));
} }
float StelObject::getVMagnitude(const StelCore* core, bool withExtinction)
const
{
Q_UNUSED(core);
Q_UNUSED(withExtinction);
return 99;
}
// Format the positional info string contain J2000/of date/altaz/hour angle positions for the object // Format the positional info string contain J2000/of date/altaz/hour angle positions for the object
QString StelObject::getPositionInfoString(const StelCore *core, const InfoS tringGroup& flags) const QString StelObject::getPositionInfoString(const StelCore *core, const InfoS tringGroup& flags) const
{ {
bool withAtmosphere=core->getSkyDrawer()->getFlagHasAtmosphere();
QString res; QString res;
if (flags&RaDecJ2000) if (flags&RaDecJ2000)
{ {
double dec_j2000, ra_j2000; double dec_j2000, ra_j2000;
StelUtils::rectToSphe(&ra_j2000,&dec_j2000,getJ2000Equatoria lPos(core)); StelUtils::rectToSphe(&ra_j2000,&dec_j2000,getJ2000Equatoria lPos(core));
res += q_("RA/DE (J2000): %1/%2").arg(StelUtils::radToHmsStr (ra_j2000,true), StelUtils::radToDmsStr(dec_j2000,true)) + "<br>"; res += q_("RA/DE (J2000): %1/%2").arg(StelUtils::radToHmsStr (ra_j2000,true), StelUtils::radToDmsStr(dec_j2000,true)) + "<br>";
} }
if (flags&RaDecOfDate) if (flags&RaDecOfDate)
{ {
double dec_equ, ra_equ; double dec_equ, ra_equ;
StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core)); StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core));
res += q_("RA/DE (of date): %1/%2").arg(StelUtils::radToHmsS tr(ra_equ), StelUtils::radToDmsStr(dec_equ)) + "<br>"; res += q_("RA/DE (of date): %1/%2").arg(StelUtils::radToHmsS tr(ra_equ), StelUtils::radToDmsStr(dec_equ)) + "<br>";
} }
if (flags&HourAngle) if (flags&HourAngle)
{ {
double dec_sideral, ra_sideral; double dec_sidereal, ra_sidereal;
StelUtils::rectToSphe(&ra_sideral,&dec_sideral,getSideralPos StelUtils::rectToSphe(&ra_sidereal,&dec_sidereal,getSideralP
Geometric(core)); osGeometric(core));
ra_sideral = 2.*M_PI-ra_sideral; ra_sidereal = 2.*M_PI-ra_sidereal;
res += q_("Hour angle/DE: %1/%2").arg(StelUtils::radToHmsStr if (withAtmosphere)
(ra_sideral), StelUtils::radToDmsStr(dec_sideral)) + " " + q_("(geometric)" {
) + "<br>"; res += q_("Hour angle/DE: %1/%2").arg(StelUtils::radToHm
StelUtils::rectToSphe(&ra_sideral,&dec_sideral,getSideralPos sStr(ra_sidereal), StelUtils::radToDmsStr(dec_sidereal)) + " " + q_("(geome
Apparent(core)); tric)") + "<br>";
ra_sideral = 2.*M_PI-ra_sideral; StelUtils::rectToSphe(&ra_sidereal,&dec_sidereal,getSide
res += q_("Hour angle/DE: %1/%2").arg(StelUtils::radToHmsStr ralPosApparent(core));
(ra_sideral), StelUtils::radToDmsStr(dec_sideral)) + " " + q_("(apparent)") ra_sidereal = 2.*M_PI-ra_sidereal;
+ "<br>"; res += q_("Hour angle/DE: %1/%2").arg(StelUtils::radToHm
sStr(ra_sidereal), StelUtils::radToDmsStr(dec_sidereal)) + " " + q_("(appar
ent)") + "<br>";
}
else
res += q_("Hour angle/DE: %1/%2").arg(StelUtils::radToHm
sStr(ra_sidereal), StelUtils::radToDmsStr(dec_sidereal)) + " " + "<br>";
} }
if (flags&AltAzi) if (flags&AltAzi)
{ {
// calculate alt az // calculate alt az
double az,alt; double az,alt;
StelUtils::rectToSphe(&az,&alt,getAltAzPosGeometric(core)); StelUtils::rectToSphe(&az,&alt,getAltAzPosGeometric(core));
az = 3.*M_PI - az; // N is zero, E is 90 degrees az = 3.*M_PI - az; // N is zero, E is 90 degrees
if (az > M_PI*2) if (az > M_PI*2)
az -= M_PI*2; az -= M_PI*2;
res += q_("Az/Alt: %1/%2").arg(StelUtils::radToDmsStr(az), S if (withAtmosphere)
telUtils::radToDmsStr(alt)) + " " + q_("(geometric)") + "<br>"; {
res += q_("Az/Alt: %1/%2").arg(StelUtils::radToDmsStr(az
StelUtils::rectToSphe(&az,&alt,getAltAzPosApparent(core)); ), StelUtils::radToDmsStr(alt)) + " " + q_("(geometric)") + "<br>";
az = 3.*M_PI - az; // N is zero, E is 90 degrees
if (az > M_PI*2) StelUtils::rectToSphe(&az,&alt,getAltAzPosApparent(core)
az -= M_PI*2; );
res += q_("Az/Alt: %1/%2").arg(StelUtils::radToDmsStr(az), S az = 3.*M_PI - az; // N is zero, E is 90 degrees
telUtils::radToDmsStr(alt)) + " " + q_("(apparent)") + "<br>"; if (az > M_PI*2)
az -= M_PI*2;
res += q_("Az/Alt: %1/%2").arg(StelUtils::radToDmsStr(az
), StelUtils::radToDmsStr(alt)) + " " + q_("(apparent)") + "<br>";
}
else
res += q_("Az/Alt: %1/%2").arg(StelUtils::radToDmsStr(az
), StelUtils::radToDmsStr(alt)) + " " + "<br>";
} }
return res; return res;
} }
// Apply post processing on the info string // Apply post processing on the info string
void StelObject::postProcessInfoString(QString& str, const InfoStringGroup& flags) const void StelObject::postProcessInfoString(QString& str, const InfoStringGroup& flags) const
{ {
// chomp trailing line breaks // chomp trailing line breaks
str.replace(QRegExp("<br(\\s*/)?>\\s*$"), ""); str.replace(QRegExp("<br(\\s*/)?>\\s*$"), "");
 End of changes. 5 change blocks. 
23 lines changed or deleted 45 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/