summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-10-01 22:51:24 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-10-01 22:53:17 (GMT)
commitb1adcc89190e7dae6e9e697b2a6a493c323588c6 (patch)
tree5fc1917d258aa9fb9ecf409436c24abbc8c19a81
parent7cb8bdab107b30eb4bfae5d542220071806b9c72 (diff)
Convenience method: recomputes both equatorial and horiz. coordinates
-rw-r--r--kstars/skyobjects/skyobject.cpp9
-rw-r--r--kstars/skyobjects/skyobject.h8
2 files changed, 16 insertions, 1 deletions
diff --git a/kstars/skyobjects/skyobject.cpp b/kstars/skyobjects/skyobject.cpp
index 3efb3b1..33916fc 100644
--- a/kstars/skyobjects/skyobject.cpp
+++ b/kstars/skyobjects/skyobject.cpp
@@ -339,6 +339,15 @@ SkyPoint SkyObject::recomputeCoords( const KStarsDateTime &dt, const GeoLocation
return p;
}
+
+SkyPoint SkyObject::recomputeHorizontalCoords(const KStarsDateTime& dt, const GeoLocation *geo) const {
+ Q_ASSERT( geo );
+ SkyPoint ret = recomputeCoords( dt, geo );
+ CachingDms LST = geo->GSTtoLST( dt.gst() );
+ ret.EquatorialToHorizontal( &LST, geo->lat() );
+ return ret;
+}
+
QString SkyObject::typeName( int t ) {
switch( t ) {
diff --git a/kstars/skyobjects/skyobject.h b/kstars/skyobjects/skyobject.h
index e367510..663b4db 100644
--- a/kstars/skyobjects/skyobject.h
+++ b/kstars/skyobjects/skyobject.h
@@ -257,14 +257,20 @@ public:
dms transitAltitude( const KStarsDateTime &dt, const GeoLocation *geo ) const;
/**
- *The coordinates for the object on date dt are computed and returned,
+ *The equatorial coordinates for the object on date dt are computed and returned,
*but the object's internal coordinates are not modified.
*@return the coordinates of the selected object for the time given by jd
*@param dt date/time for which the coords will be computed.
*@param geo pointer to geographic location (used for solar system only)
+ *@note Does not update the horizontal coordinates. Call EquatorialToHorizontal for that.
*/
SkyPoint recomputeCoords( const KStarsDateTime &dt, const GeoLocation *geo=0 ) const;
+ /**
+ * @short Like recomputeCoords, but also calls EquatorialToHorizontal before returning
+ */
+ SkyPoint recomputeHorizontalCoords( const KStarsDateTime &dt, const GeoLocation *geo ) const;
+
inline bool hasName() const { return ! Name.isEmpty(); }
inline bool hasName2() const { return ! Name2.isEmpty(); }