Revision 649384

Go back to digest for 8th April 2007

Features in Educational

Jason Harris committed changes in /trunk/KDE/kdeedu/kstars/kstars:

Refactored the constellation boundaries

Previously, boundaries were stored as "segments", each of which was the boundary between two constellations. A single constellation's boundary could be any number of segments, depending on how many other constellations it borders. Each segment also contained the name of the two constellations which it divided. Under this scheme, it was CPU-intensive to determine which constellation a particular point was in, and there were many corner cases. However, the advantage of this method over simply storing each constellation's full boundary is that it avoids having redundant representation of each boundary.

Now I have switched to the more intuitive method of storing each constellation's full boundary. ConstellationBoundaryComponent is a LineListComponent, containing all of the non-redundant constellation boundary segments. However, it also represents each full boundary internally in a QHash of QPolygonF's. This representation is much more convenient for drawing the highlighted constellation boundary, and for determining which constellation a given SkyPoint is in. I also added a new function 'bool SkyMapComposite::inConstellation( const QString &name, SkyPoint *p )', which returns true if the point p is inside the constellation named name. This function will be useful (for example) in the Observing List Wizard, when the user wants to select objects which are in a particular constellation.

In fact, these changes were initially prompted by a bug report that selecting by constellation in the ObsList wizard is very slow. Hopefully, these changes will help make it faster.

Note that the cbounds.dat data file has been removed; the constellation boundaries are now stored in 88 files named *.cbound, one per constellation.

TODO: there's a problem with the 'QString constellation( SkyPoint *p )' function; there are many points on the sky where it fails to identify the containing constellation. I don't understand what the problem could be, because I'm simply using the QPolygonF::contains() function here. I'll look into it.

File Changes

Added 89 files
  • /trunk/KDE/kdeedu/kstars/kstars/data
  •   /AND.cbound
  •   /ANT.cbound
  •   /APS.cbound
  •   /AQL.cbound
  •   /AQR.cbound
  •   /ARA.cbound
  •   /ARI.cbound
  •   /AUR.cbound
  •   /BOO.cbound
  •   /CAE.cbound
  •   /CAM.cbound
  •   /CAP.cbound
  •   /CAR.cbound
  •   /CAS.cbound
  •   /CEN.cbound
  •   /CEP.cbound
  •   /CET.cbound
  •   /CHA.cbound
  •   /CIR.cbound
  •   /CMA.cbound
  •   /CMI.cbound
  •   /CNC.cbound
  •   /COL.cbound
  •   /COM.cbound
  •   /CRA.cbound
  •   /CRB.cbound
  •   /CRT.cbound
  •   /CRU.cbound
  •   /CRV.cbound
  •   /CVN.cbound
  •   /CYG.cbound
  •   /DEL.cbound
  •   /DOR.cbound
  •   /DRA.cbound
  •   /EQU.cbound
  •   /ERI.cbound
  •   /FOR.cbound
  •   /GEM.cbound
  •   /GRU.cbound
  •   /HER.cbound
  •   /HOR.cbound
  •   /HYA.cbound
  •   /HYI.cbound
  •   /IND.cbound
  •   /LAC.cbound
  •   /LEO.cbound
  •   /LEP.cbound
  •   /LIB.cbound
  •   /LMI.cbound
  •   /LUP.cbound
  •   /LYN.cbound
  •   /LYR.cbound
  •   /MEN.cbound
  •   /MIC.cbound
  •   /MON.cbound
  •   /MUS.cbound
  •   /NOR.cbound
  •   /OCT.cbound
  •   /OPH.cbound
  •   /ORI.cbound
  •   /PAV.cbound
  •   /PEG.cbound
  •   /PER.cbound
  •   /PHE.cbound
  •   /PIC.cbound
  •   /PSA.cbound
  •   /PSC.cbound
  •   /PUP.cbound
  •   /PYX.cbound
  •   /RET.cbound
  •   /SCD.cbound
  •   /SCL.cbound
  •   /SCO.cbound
  •   /SCP.cbound
  •   /SCT.cbound
  •   /SEX.cbound
  •   /SGE.cbound
  •   /SGR.cbound
  •   /TAU.cbound
  •   /TEL.cbound
  •   /TRA.cbound
  •   /TRI.cbound
  •   /TUC.cbound
  •   /UMA.cbound
  •   /UMI.cbound
  •   /VEL.cbound
  •   /VIR.cbound
  •   /VOL.cbound
  •   /VUL.cbound
Deleted 3 files
  • /trunk/KDE/kdeedu/kstars/kstars
  •   /csegment.cpp
  •   /csegment.h
  •   /data/cbound.dat
Modified 15 files
  • /trunk/KDE/kdeedu/kstars/kstars
  •   /CMakeLists.txt
  •   /kstarsdata.cpp
  •   /kstarsdata.h
  •   /skymap.h
  •   /skymapdraw.cpp
  •   /skypoint.cpp
  •   /skypoint.h
  •   /data/CMakeLists.txt
  •   /skycomponents/constellationboundarycomponent.cpp
  •   /skycomponents/constellationboundarycomponent.h
  •   /skycomponents/constellationlinescomponent.cpp
  •   /skycomponents/README
  •   /skycomponents/skymapcomposite.cpp
  •   /skycomponents/skymapcomposite.h
  •   /widgets/mapcanvas.cpp
107 files changed in total