[Kstars-devel] KDE/kdeedu/kstars/kstars

Akarsh Simha akarshsimha at gmail.com
Sat Jul 19 18:51:46 CEST 2008


SVN commit 834846 by asimha:

+ Removing commented code for overloaded StarObject::init().

+ Fixing issues with the debugging code for proper motion that is kept
commented out in starobject.cpp

CCMAIL: kstars-devel at kde.org



 M  +26 -46    starobject.cpp  
 M  +0 -23     starobject.h  


--- trunk/KDE/kdeedu/kstars/kstars/starobject.cpp #834845:834846
@@ -29,6 +29,10 @@
 #include "Options.h"
 #include "skymap.h"
 
+// DEBUG EDIT. Uncomment for testing Proper Motion
+//#include "skycomponents/skymesh.h"
+// END DEBUG
+
 #include "skycomponents/skylabeler.h"
 
 QMap<QString, QColor> StarObject::ColorMap;
@@ -123,31 +127,6 @@
 }
 
 
-// DEPRECATED
-/*
-void StarObject::init(double r, double d, float m, const QString &sptype, double pmra, 
-                      double pmdec, double par, bool mult, bool var) 
-{
-    setType( SkyObject::STAR );
-    setMag( m );
-    setRA0( r );
-    setDec0( d );
-    setRA( r );
-    setDec( d );
-    const char *spt = (const char *)sptype.toAscii();
-    SpType[0] = spt[0];
-    SpType[1] = spt[1];
-    PM_RA = pmra;
-    PM_Dec = pmdec;
-    Parallax = par;
-    Multiplicity = mult;
-    Variability = var ;
-
-    //    setLongName(i18n("star"));
-    updateID = updateNumID = 0;
-}
-*/
-
 void StarObject::init( const starData *stardata ) 
 {
     double ra, dec;
@@ -176,7 +155,7 @@
     //          due to the memcpy() that we do to create stars
     /*
     testStar = false;
-    if( stardata->HD == 224635 ) {
+    if( stardata->HD == 103095 && Trail.size() == 0 ) {
       // Populate Trail with various positions
         kDebug() << "TEST STAR FOUND!";
         testStar = true;
@@ -191,7 +170,7 @@
         kDebug() << "Populated the star's trail with " << Trail.size() << " entries.";
     }
     */
-    // END EDIT.
+    // END DEBUG.
 
 
 }
@@ -312,18 +291,6 @@
     setRA0( newRA );
     setDec0( newDec );
 
-    // DEBUG Edit. Uncomment all related blocks for testing proper motion.
-    /*
-    if( testStar ) {
-        kDebug() << "Test Star. update method";
-        KStarsData *data = KStarsData::Instance();
-        for( int i = 0; i < Trail.size(); i++ ) {
-            Trail.at( i )->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
-        }
-    }
-    */
-    // END EDIT.
-
     SkyPoint::updateCoords( num );
     setRA0( saveRA );
     setDec0( saveDec );
@@ -568,7 +535,20 @@
     /*
     if( !testStar )
         return;
-    
+
+    dms *ra, *dec;
+    ra = new dms;
+    dec = new dms;
+    KStarsData *data = KStarsData::Instance();
+    SkyMesh *m_skyMesh = SkyMesh::Instance();
+
+    for( int i = 0; i < Trail.size(); i++ ) {
+        //        kDebug() << "Point" << i << "in trixel" << m_skyMesh->indexToName( m_skyMesh->index( Trail.at( i ) ) );
+        Trail.at( i )->updateCoords( data->updateNum(),  true, ra, dec );
+        Trail.at( i )->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+    }
+
+
     SkyMap *map = SkyMap::Instance();
     SkyPoint *pThis, *pLast;
     QPointF oThis, oMid, oLast;
@@ -580,17 +560,17 @@
     pLast = Trail.first();
     oLast = map->toScreen( pLast, true, &isVisibleLast );
     center = map->toScreen( map->focus() );
-    kDebug() << "Entering draw routine to draw PM arc.";
+    //    kDebug() << "Entering draw routine to draw PM arc.";
     for ( int i = 1; i < Trail.size(); i++ ) {
         pThis = Trail.at( i );
         oThis = map->toScreen( pThis, true, &isVisible );
         if ( map->onScreen( oThis, oLast) ) {
-            kDebug() << "We have a segment on map!";                
+            //            kDebug() << "We have a segment on map!";                
             if ( isVisible && isVisibleLast ) {
-                kDebug() << "Drawing line from (" << oLast.x() - center.x() << "," << oLast.y() - center.y() << ") to (" 
-                         << oThis.x() - center.x() << "," << oThis.y() - center.y() << ")" << endl;
-                kDebug() << "Or " << pThis->ra()->toHMSString() << "," << pThis->dec()->toDMSString() << "to"
-                         << pLast->ra()->toHMSString() << "," << pLast->dec()->toDMSString();
+                //                kDebug() << "Drawing line from (" << oLast.x() - center.x() << "," << oLast.y() - center.y() << ") to (" 
+                //                         << oThis.x() - center.x() << "," << oThis.y() - center.y() << ")" << endl;
+                //                kDebug() << "Or " << pThis->ra()->toHMSString() << "," << pThis->dec()->toDMSString() << "to"
+                //                         << pLast->ra()->toHMSString() << "," << pLast->dec()->toDMSString();
                 psky.drawLine( oLast, oThis );
             }
             else if ( isVisibleLast ) {
--- trunk/KDE/kdeedu/kstars/kstars/starobject.h #834845:834846
@@ -95,7 +95,6 @@
      */
     ~StarObject() { }
 
-    // REMOVED
     /**
      *@short  Initializes a StarObject to given data
      *
@@ -103,28 +102,6 @@
      * setting up name, gname etc for unnamed stars. If called instead of the
      * constructor, this method will be much faster for unnamed stars
      *
-     *@param r Right Ascension [Hours]
-     *@param d Declination [Degrees]
-     *@param m Magnitude
-     *@param sptype Spectral Type
-     *@param pmra Proper motion in RA direction [mas/yr]
-     *@param pmdec Proper motion in Dec direction [mas/yr]
-     *@param par Parallax angle [mas]
-     *@param mult Multiplicity flag (false=dingle star; true=multiple star)
-     *@param var Variability flag (true if star is a known periodic variable)
-     *@return Nothing
-     */
-
-    //    void init(double r, double d, float m=0.0, const QString &sptype="--", double pmra=0.0, double pmdec=0.0, 
-    //              double par=0.0, bool mult=false, bool var=false);
-
-    /**
-     *@short  Initializes a StarObject to given data
-     *
-     * This is almost like the StarObject constructor itself, but it avoids
-     * setting up name, gname etc for unnamed stars. If called instead of the
-     * constructor, this method will be much faster for unnamed stars
-     *
      *@param  stardata  Pointer to starData object containing required data (except name and gname)
      *@return Nothing
      */


More information about the Kstars-devel mailing list