[Kstars-devel] KDE/kdeedu/kstars/kstars
Akarsh Simha
akarshsimha at gmail.com
Tue Apr 7 10:05:13 CEST 2009
SVN commit 950448 by asimha:
Adding support for a few more types of SkyObjects: Asterisms, Dark
Nebulae, Multiple (catalog) Stars, Galaxy Clusters and Quasars.
CCMAIL: kstars-devel at kde.org
M +1 -1 dialogs/detaildialog.cpp
M +7 -1 kstarsdata.cpp
M +1 -1 kstarsdata.h
M +3 -2 skymapdraw.cpp
M +51 -2 skyobjects/deepskyobject.cpp
M +2 -1 skyobjects/skyobject.h
--- trunk/KDE/kdeedu/kstars/kstars/dialogs/detaildialog.cpp #950447:950448
@@ -967,7 +967,7 @@
void DetailDialog::showThumbnail() {
//No image if object is a star
if ( selectedObject->type() == SkyObject::STAR ||
- selectedObject->type() == SkyObject::CATALOG_STAR ) {
+ selectedObject->type() == SkyObject::CATALOG_STAR ) {
Thumbnail->scaled( Data->Image->width(), Data->Image->height() );
Thumbnail->fill( Data->DataFrame->palette().color( QPalette::Window ) );
Data->Image->setPixmap( *Thumbnail );
--- trunk/KDE/kdeedu/kstars/kstars/kstarsdata.cpp #950447:950448
@@ -82,7 +82,7 @@
objects++;
TypeName[0] = i18n( "star" );
- TypeName[1] = i18n( "multiple star" );
+ TypeName[1] = i18n( "star" );
TypeName[2] = i18n( "planet" );
TypeName[3] = i18n( "open cluster" );
TypeName[4] = i18n( "globular cluster" );
@@ -93,6 +93,12 @@
TypeName[9] = i18n( "comet" );
TypeName[10] = i18n( "asteroid" );
TypeName[11] = i18n( "constellation" );
+ TypeName[12] = i18n( "Moon" );
+ TypeName[13] = i18n( "asterism" );
+ TypeName[14] = i18n( "galaxy cluster" );
+ TypeName[15] = i18n( "dark nebula" );
+ TypeName[16] = i18n( "quasar" );
+ TypeName[17] = i18n( "multiple star" );
//standard directories and locale objects
locale = new KLocale( "kstars" );
--- trunk/KDE/kdeedu/kstars/kstars/kstarsdata.h #950447:950448
@@ -486,7 +486,7 @@
int initCounter;
- QString TypeName[12];
+ QString TypeName[18];
//--- Static member variables
//the number of KStarsData objects.
--- trunk/KDE/kdeedu/kstars/kstars/skymapdraw.cpp #950447:950448
@@ -315,7 +315,7 @@
foreach ( SkyObject *obj, labelObjects ) {
//Only draw an attached label if the object is being drawn to the map
//reproducing logic from other draw funcs here...not an optimal solution
- if ( obj->type() == SkyObject::STAR ) {
+ if ( obj->type() == SkyObject::STAR || obj->type() == SkyObject::CATALOG_STAR || obj->type() == SkyObject::MULT_STAR ) {
if ( ! drawStars ) continue;
// if ( obj->mag() > Options::magLimitDrawStar() ) continue;
if ( hideFaintStars && obj->mag() > Options::magLimitHideStar() ) continue;
@@ -333,7 +333,8 @@
if ( obj->name() == i18n( "Neptune" ) && ! Options::showNeptune() ) continue;
if ( obj->name() == i18n( "Pluto" ) && ! Options::showPluto() ) continue;
}
- if ( obj->type() >= SkyObject::OPEN_CLUSTER && obj->type() <= SkyObject::GALAXY ) {
+ if ( obj->type() >= SkyObject::OPEN_CLUSTER && obj->type() <= SkyObject::GALAXY
+ || obj->type() >= SkyObject::ASTERISM || obj->type() <= SkyObject::QUASAR ) {
if ( ((DeepSkyObject*)obj)->isCatalogM() && ! drawMessier ) continue;
if ( ((DeepSkyObject*)obj)->isCatalogNGC() && ! drawNGC ) continue;
if ( ((DeepSkyObject*)obj)->isCatalogIC() && ! drawIC ) continue;
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/deepskyobject.cpp #950447:950448
@@ -155,12 +155,12 @@
case 2: //Planet
break;
case 3: //Open cluster; draw circle of points
+ case 13: // Asterism
tempBrush = psky.brush();
psky.setBrush( psky.pen().color() );
psize = 2.;
if ( size > 50. ) psize *= 2.;
if ( size > 100. ) psize *= 2.;
-
if ( Options::useAntialias() ) {
psky.drawEllipse( QRectF(xa, y1, psize, psize) );
psky.drawEllipse( QRectF(xb, y1, psize, psize) );
@@ -185,7 +185,7 @@
psky.drawEllipse( QRect(ix2, iyb, int(psize), int(psize)) );
}
psky.setBrush( tempBrush );
- break;
+ break;
case 4: //Globular Cluster
if (size<2.) size = 2.;
psky.save();
@@ -208,6 +208,7 @@
break;
case 5: //Gaseous Nebula
+ case 15: // Dark Nebula
if (size <2.) size = 2.;
psky.save();
psky.translate( x, y );
@@ -275,6 +276,7 @@
psky.restore(); //reset coordinate system
break;
case 8: //Galaxy
+ case 16: // Quasar
if ( size <1. && zoom > 20*MINZOOM ) size = 3.; //force ellipse above zoomFactor 20
if ( size <1. && zoom > 5*MINZOOM ) size = 1.; //force points above zoomFactor 5
if ( size>2. ) {
@@ -295,6 +297,53 @@
psky.drawPoint( QPointF(x, y) );
}
break;
+ case 14: // Galaxy cluster - draw a circle of + marks
+ tempBrush = psky.brush();
+ psky.setBrush( psky.pen().color() );
+ psize = 1.;
+ if ( size > 50. ) psize *= 2.;
+
+ if ( Options::useAntialias() ) {
+ psky.drawLine( QLineF( xa-psize, y1, xa+psize, y1 ) );
+ psky.drawLine( QLineF( xa, y1-psize, xa, y1+psize ) );
+ psky.drawLine( QLineF( xb-psize, y1, xa+psize, y1 ) );
+ psky.drawLine( QLineF( xb, y1-psize, xa, y1+psize ) );
+ psky.drawLine( QLineF( xa-psize, y2, xa+psize, y1 ) );
+ psky.drawLine( QLineF( xa, y2-psize, xa, y1+psize ) );
+ psky.drawLine( QLineF( xb-psize, y2, xa+psize, y1 ) );
+ psky.drawLine( QLineF( xb, y2-psize, xa, y1+psize ) );
+ psky.drawLine( QLineF( x1-psize, ya, xa+psize, y1 ) );
+ psky.drawLine( QLineF( x1, ya-psize, xa, y1+psize ) );
+ psky.drawLine( QLineF( x1-psize, yb, xa+psize, y1 ) );
+ psky.drawLine( QLineF( x1, yb-psize, xa, y1+psize ) );
+ psky.drawLine( QLineF( x2-psize, ya, xa+psize, y1 ) );
+ psky.drawLine( QLineF( x2, ya-psize, xa, y1+psize ) );
+ psky.drawLine( QLineF( x2-psize, yb, xa+psize, y1 ) );
+ psky.drawLine( QLineF( x2, yb-psize, xa, y1+psize ) );
+ } else {
+ int ix1 = int(x1); int iy1 = int(y1);
+ int ix2 = int(x2); int iy2 = int(y2);
+ int ixa = int(xa); int iya = int(ya);
+ int ixb = int(xb); int iyb = int(yb);
+ psky.drawLine( QLine( ixa - int(psize), iy1, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ixa, iy1 - int(psize), ixa, iy1 + int(psize) ) );
+ psky.drawLine( QLine( ixb - int(psize), iy1, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ixb, iy1 - int(psize), ixa, iy1 + int(psize) ) );
+ psky.drawLine( QLine( ixa - int(psize), iy2, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ixa, iy2 - int(psize), ixa, iy1 + int(psize) ) );
+ psky.drawLine( QLine( ixb - int(psize), iy2, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ixb, iy2 - int(psize), ixa, iy1 + int(psize) ) );
+ psky.drawLine( QLine( ix1 - int(psize), iya, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ix1, iya - int(psize), ixa, iy1 + int(psize) ) );
+ psky.drawLine( QLine( ix1 - int(psize), iyb, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ix1, iyb - int(psize), ixa, iy1 + int(psize) ) );
+ psky.drawLine( QLine( ix2 - int(psize), iya, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ix2, iya - int(psize), ixa, iy1 + int(psize) ) );
+ psky.drawLine( QLine( ix2 - int(psize), iyb, ixa + int(psize), iy1 ) );
+ psky.drawLine( QLine( ix2, iyb - int(psize), ixa, iy1 + int(psize) ) );
+ }
+ psky.setBrush( tempBrush );
+ break;
}
}
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/skyobject.h #950447:950448
@@ -87,7 +87,8 @@
*/
enum TYPE { STAR=0, CATALOG_STAR=1, PLANET=2, OPEN_CLUSTER=3, GLOBULAR_CLUSTER=4,
GASEOUS_NEBULA=5, PLANETARY_NEBULA=6, SUPERNOVA_REMNANT=7, GALAXY=8,
- COMET=9, ASTEROID=10, CONSTELLATION=11, MOON=12, TYPE_UNKNOWN };
+ COMET=9, ASTEROID=10, CONSTELLATION=11, MOON=12, ASTERISM=13,
+ GALAXY_CLUSTER=14, DARK_NEBULA=15, QUASAR=16, MULT_STAR=17, TYPE_UNKNOWN };
/**
*@return object's primary name.
More information about the Kstars-devel
mailing list