StelObject.cpp   StelObject.cpp 
skipping to change at line 21 skipping to change at line 21
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include "StelObject.hpp" #include "StelObject.hpp"
#include "Navigator.hpp" #include "StelNavigator.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "Projector.hpp" #include "StelProjector.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "Translator.hpp" #include "StelTranslator.hpp"
#include <QRegExp> #include <QRegExp>
#include <QDebug> #include <QDebug>
void intrusive_ptr_add_ref(StelObject* p) void intrusive_ptr_add_ref(StelObject* p)
{ {
p->retain(); p->retain();
} }
void intrusive_ptr_release(StelObject* p) void intrusive_ptr_release(StelObject* p)
{ {
p->release(); p->release();
} }
Vec3d StelObject::getObsEquatorialPos(const Navigator* nav) const Vec3d StelObject::getEquinoxEquatorialPos(const StelNavigator* nav) const
{ {
return nav->j2000ToEarthEqu(getObsJ2000Pos(nav)); return nav->j2000ToEquinoxEqu(getJ2000EquatorialPos(nav));
} }
// Return the radius of a circle containing the object on screen // Return the radius of a circle containing the object on screen
float StelObject::getOnScreenSize(const StelCore* core) const // float StelObject::getOnScreenSize(const StelCore* core, const StelProjec
{ torP& prj) const
return getAngularSize(core)*M_PI/180.*core->getProjection()->getPixe // {
lPerRadAtCenter(); // return getAngularSize(core)*M_PI/180.*prj->getPixelPerRadAtCenter();
} // }
// Get observer local sideral coordinate // Get observer local sideral coordinate
Vec3d StelObject::getObsSideralPos(const StelCore* core) const Vec3d StelObject::getSideralPos(const StelCore* core) const
{ {
return Mat4d::zrotation(-core->getNavigation()->getLocalSideralTime( ))* getObsEquatorialPos(core->getNavigation()); return Mat4d::zrotation(-core->getNavigator()->getLocalSideralTime() )* getEquinoxEquatorialPos(core->getNavigator());
} }
// Get observer local alt/az coordinate // Get observer-centered alt/az position
Vec3d StelObject::getAltAzPos(const Navigator* nav) const Vec3d StelObject::getAltAzPos(const StelNavigator* nav) const
{ {
return nav->j2000ToLocal(getObsJ2000Pos(nav)); return nav->j2000ToAltAz(getJ2000EquatorialPos(nav));
} }
// 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
{ {
QString res; QString res;
const Navigator* nav = core->getNavigation(); const StelNavigator* nav = core->getNavigator();
if (flags&RaDecJ2000) if (flags&RaDecJ2000)
{ {
double dec_j2000, ra_j2000; double dec_j2000, ra_j2000;
StelUtils::rectToSphe(&ra_j2000,&dec_j2000,getObsJ2000Pos(na v)); StelUtils::rectToSphe(&ra_j2000,&dec_j2000,getJ2000Equatoria lPos(nav));
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,getObsEquatorialPos(n av)); StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(nav));
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_sideral, ra_sideral;
StelUtils::rectToSphe(&ra_sideral,&dec_sideral,getObsSideral Pos(core)); StelUtils::rectToSphe(&ra_sideral,&dec_sideral,getSideralPos (core));
ra_sideral = 2.*M_PI-ra_sideral; ra_sideral = 2.*M_PI-ra_sideral;
res += q_("Hour angle/DE: %1/%2").arg(StelUtils::radToHmsStr (ra_sideral), StelUtils::radToDmsStr(dec_sideral)) + "<br>"; res += q_("Hour angle/DE: %1/%2").arg(StelUtils::radToHmsStr (ra_sideral), StelUtils::radToDmsStr(dec_sideral)) + "<br>";
} }
if (flags&AltAzi) if (flags&AltAzi)
{ {
// calculate alt az // calculate alt az
double az,alt; double az,alt;
StelUtils::rectToSphe(&az,&alt,getAltAzPos(nav)); StelUtils::rectToSphe(&az,&alt,getAltAzPos(nav));
az = 3.*M_PI - az; // N is zero, E is 90 degrees az = 3.*M_PI - az; // N is zero, E is 90 degrees
 End of changes. 14 change blocks. 
19 lines changed or deleted 19 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/