[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Alexey Khudyakov <alexey.skladnoy () gmail ! com>
Date:       2010-01-31 14:07:19
Message-ID: 1264946839.376434.8514.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1082920 by khudyakov:

Merge SkipListIndex and MilkyWay classes

 M  +0 -1      CMakeLists.txt  
 M  +14 -1     skycomponents/milkyway.cpp  
 M  +23 -3     skycomponents/milkyway.h  
 D             skycomponents/skiplistindex.cpp  
 D             skycomponents/skiplistindex.h  


--- trunk/KDE/kdeedu/kstars/kstars/CMakeLists.txt #1082919:1082920
@@ -175,7 +175,6 @@
    skycomponents/linelistindex.cpp
    skycomponents/linelistlabel.cpp
    skycomponents/noprecessindex.cpp
-   skycomponents/skiplistindex.cpp
    skycomponents/polylistindex.cpp
    skycomponents/singlecomponent.cpp 
    skycomponents/listcomponent.cpp 
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/milkyway.cpp #1082919:1082920
@@ -30,14 +30,27 @@
 #include "dms.h"
 #include "Options.h"
 #include "ksfilereader.h"
+#include "skycomponents/skiplist.h"
 
 #include "skymesh.h"
 
 
 MilkyWay::MilkyWay( SkyComponent *parent ) :
-        SkipListIndex( parent, i18n("Milky Way") )
+    LineListIndex( parent, i18n("Milky Way") )
 {}
 
+const IndexHash& MilkyWay::getIndexHash(LineList* lineList ) {
+    // FIXME: EVIL!
+    SkipList* skipList = (SkipList*) lineList;
+    return skyMesh()->indexLine( skipList->points(), skipList->skipHash() );
+}
+
+bool MilkyWay::skipAt( LineList* lineList, int i ) {
+    // FIXME: EVIL!
+    SkipList* skipList = (SkipList*) lineList;
+    return skipList->skip( i );
+}
+
 void MilkyWay::init()
 {
     intro();
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/milkyway.h #1082919:1082920
@@ -18,16 +18,21 @@
 #ifndef MILKYWAY_H
 #define MILKYWAY_H
 
-#include "skiplistindex.h"
+#include "linelistindex.h"
 
 /** @class MlkyWay
  *
- * Specialize SkipListIndex for drawing Milky Way and Magellanic clouds.
+ * Draw filled areas as Milky Way and Magellanic clouds.
  *
+ * This class should store SkipLists instead of LineLists.  The two methods
+ * are used inside of LineListIndex to access the SkipLists' skip hashes.
+ * This way the same code in LineListIndex does double duty. Only subclassed
+ * by MilkyWay.
+ *
  * @author James B. Bowlin
  * @version 0.1
  */
-class MilkyWay : public SkipListIndex
+class MilkyWay : public LineListIndex
 {
 public:
     /**@short Constructor
@@ -38,6 +43,21 @@
     /** Load skiplists from file */
     void loadContours(QString fname, QString greeting);
 
+    // FIXME: Implementation is broken!!
+    /**@short Returns an IndexHash from the SkyMesh that contains the set
+     * of trixels that cover the _SkipList_ lineList excluding skipped
+     * lines as specified in the SkipList.  SkipList is a subclass of
+     * LineList.
+     */
+    const IndexHash& getIndexHash( LineList* skipList );
+
+    // FIXME: Implementation is broken!!
+    /**@short Returns a boolean indicating whether to skip the i-th line
+     * segment in the _SkipList_ skipList.  Note that SkipList is a
+     * subclass of LineList.  This routine allows us to use the drawing
+     * code in LineListIndex instead of repeating it all here.
+     */
+    bool skipAt( LineList* skpiList, int i );
     
     virtual void init();
     virtual void draw( QPainter& psky );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic