summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelarkode Suresh Adityan <[email protected]>2015-06-23 23:12:34 +0530
committerMelarkode Suresh Adityan <[email protected]>2015-06-23 23:12:34 +0530
commit657d2b0f3a369843489a37bbfd8f9462ee12af28 (patch)
treeae16ffd2de0a75047c014f9528e47c15184d648c
parentb4c43c7bebf2e94e5abafdab85045e6a8c2c3f89 (diff)
Review commit for Jasem.
-rw-r--r--kstars/data/skycultures/western/constellationsart.txt89
-rw-r--r--kstars/skycomponents/constellationartcomponent.cpp76
-rw-r--r--kstars/skycomponents/constellationartcomponent.h8
-rw-r--r--kstars/skycomponents/skymapcomposite.cpp4
-rw-r--r--kstars/skyobjects/constellationsart.cpp3
-rw-r--r--kstars/skyobjects/constellationsart.h28
6 files changed, 81 insertions, 127 deletions
diff --git a/kstars/data/skycultures/western/constellationsart.txt b/kstars/data/skycultures/western/constellationsart.txt
index c3a0b8b..cccd42d 100644
--- a/kstars/data/skycultures/western/constellationsart.txt
+++ b/kstars/data/skycultures/western/constellationsart.txt
@@ -12,89 +12,6 @@
# This catalog has the following columns.
# Constellation serial number,x1,y1,HD1,x2,y2,HD2,x3,y3,HD3,Abbrev, Image file
# where xn,yn,HDn stand for x-coordinate of pixel of star n, y-coordinate of pixel of star n, HD number of star n
-# x1 y1 hd1 x2 y2 hd2 x3 y3 hd3 Abbrev Image file
-1 198 215 4727 337 136 3627 224 428 12533 And andromeda
-2 4 84 90610 72 69 84367 42 120 86629 Ant antlia
-3 66 60 149324 76 87 147675 163 110 129078 Aps apus
-4 163 232 187642 385 131 176411 397 397 177756 Aql aquila
-5 144 464 220321 179 98 209750 465 49 198001 Aqr aquarius
-6 98 70 152786 191 93 158094 107 249 165024 Ara ara
-7 12 130 17573 58 206 18519 210 47 11502 Ari aries
-8 196 189 40312 419 208 34029 290 423 31398 Aur auriga
-9 225 222 129989 365 184 127762 207 401 121370 Boo bootes
-10 16 231 28873 76 145 29875 199 75 29992 Cae caelum
-11 77 46 33564 128 135 30614 219 136 21291 Cam camelopardalis
-12 29 166 76756 101 255 69267 206 91 69897 Cnc cancer
-13 15 436 207098 403 7 192947 460 438 198542 Cap capricornus
-14 202 455 80007 62 216 88955 298 22 67523 Car argonavis
-15 390 336 11415 163 156 3712 73 243 432 Cas cassiopeia
-16 118 157 123139 194 444 128620 463 412 100841 Cen centaurus
-17 60 335 222404 125 170 205021 335 147 210745 Cep cepheus
-18 87 63 18883 28 274 17081 412 440 1522 Cet cetus
-19 29 214 106911 73 123 92305 184 33 71243 Cha chamaeleon
-20 5 36 136415 39 11 135379 235 239 128898 Cir circinus
-21 21 347 58350 321 24 50778 318 492 44402 CMa canis-major
-22 96 43 62832 101 171 61421 184 124 58715 CMi canis-minor
-23 139 29 44762 40 190 40808 204 211 36597 Col columba
-24 27 199 114378 38 58 114710 172 64 108381 Com coma-berenices
-25 14 142 177474 218 34 170642 195 208 175219 CrA corona-australis
-26 16 186 143807 201 203 140436 157 20 138749 CrB corona-borealis
-27 45 41 103632 160 149 55282 55 242 97277 Crt crater
-28 112 21 108903 42 20 111123 21 106 108248 Cru crux
-29 65 59 108767 77 235 109379 213 187 105707 Crv corvus
-30 117 113 113797 206 40 109358 207 152 109317 Cvn canes-venatici
-31 7 382 206826 474 46 181276 467 453 183913 Cyg cygnus
-32 59 31 197964 75 148 198390 211 143 195810 Del delphinus
-33 56 197 40409 75 228 39014 219 46 27290 Dor dorado
-34 13 411 100029 361 154 159181 449 429 188119 Dra draco
-35 17 180 201601 149 86 202448 160 160 203562 Equ equuleus
-36 41 95 30211 296 44 18322 493 490 10144 Eri eridanus
-37 42 125 20010 128 37 17729 190 129 17652 For fornax
-38 14 81 62345 117 252 48737 249 165 41116 Gem gemini
-39 49 109 218227 85 206 215789 220 45 207971 Gru grus
-40 44 115 147547 254 477 147394 441 102 166014 Her hercules
-41 16 235 26967 184 67 16920 235 119 19319 Hor horlogium
-42 26 491 115659 111 149 98664 401 33 76294 Hya hydra
-43 14 204 12311 201 43 2151 241 215 24512 Hyi hydrus
-44 64 143 196171 154 20 198700 175 98 202730 Ind indus
-45 249 42 212496 108 123 213420 67 215 211388 Lac lacerta
-46 69 411 102647 383 186 87901 321 32 84441 Leo leo
-47 21 48 41695 246 62 33802 213 235 32887 Lep lepus
-48 41 27 135742 58 170 142198 224 107 133216 Lib libra
-49 8 40 94264 214 127 82635 61 155 88960 LMi leo-minor
-50 90 257 134505 207 435 126354 425 239 136422 Lup lupus
-51 100 216 76943 337 212 58142 472 119 43378 Lyn lynx
-52 100 96 175588 157 38 172167 139 162 174638 Lyr lyra
-53 100 67 30612 179 136 37763 54 183 43107 Men mensa
-54 122 226 202627 168 148 199951 234 115 198232 Mic microscopium
-55 20 306 67594 394 80 47839 509 359 43232 Mon monoceros
-56 57 52 109026 177 68 110879 129 236 102249 Mus musca
-57 17 45 143546 101 38 145397 16 112 147971 Nor norma
-58 15 16 124882 236 239 205478 247 140 214846 Oct octans
-59 5 183 175638 452 47 141003 238 453 158643 Oph ophiuchus
-60 59 11 39587 329 477 38771 421 91 30652 Ori orion
-61 55 60 193924 110 208 188228 235 146 160635 Pav pavo
-62 164 41 206778 47 283 210459 409 349 886 Peg pegasus
-63 164 323 24760 299 175 20902 385 386 17584 Per perseus
-64 55 243 11695 209 15 496 229 214 6882 Phe phoenix
-65 4 252 50241 148 138 39523 167 38 39060 Pic pictor
-66 190 5 216763 82 202 207155 236 92 214748 PsA piscis-austrinus
-67 24 104 6118 111 489 12446 481 155 219615 Psc pisces
-68 152 220 72227 94 159 74575 44 202 74006 Pyx pyxis
-69 47 56 25422 78 88 27256 16 111 27442 Ret reticulum
-70 231 39 219784 240 106 221507 32 174 5737 Scl sculptor
-71 447 29 144217 62 365 158926 217 462 152334 Sco scorpius
-72 52 17 173764 224 124 170296 139 206 175156 Sct scutum
-73 26 54 90994 68 36 87887 118 84 85558 Sex sextans
-74 6 12 190608 249 213 185758 218 243 185958 Sge sagitta
-75 96 82 181577 307 492 181623 506 100 161592 Sgr sagittarius
-76 13 92 37202 399 438 21120 382 192 24076 Tau taurus
-77 30 66 172128 101 40 169467 106 92 169767 Tel telescopium
-78 26 12 141891 108 15 135382 60 106 150798 Tra triangulum-australe
-79 16 42 13161 13 70 13869 97 78 11443 Tri triangulum
-80 53 121 2884 154 86 219571 224 141 211416 Tuc tucana
-81 26 75 120315 452 272 71369 258 394 89021 UMa ursa-major
-82 15 20 8890 193 51 106112 93 209 148048 UMi ursa-minor
-83 65 389 130109 454 57 102212 338 382 116658 Vir virgo
-84 55 85 78045 210 122 57623 207 163 55865 Vol volans
-85 35 133 189849 174 111 183439 242 135 180554 Vul vulpecula
+# x1 y1 hd1 x2 y2 hd2 Star1J2000 Star2J2000 Abbrev Image file
+1 198 215 4727 337 136 3627 004948+410444 003919+305139 And andromeda
+
diff --git a/kstars/skycomponents/constellationartcomponent.cpp b/kstars/skycomponents/constellationartcomponent.cpp
index 9d08c9f..2a79d52 100644
--- a/kstars/skycomponents/constellationartcomponent.cpp
+++ b/kstars/skycomponents/constellationartcomponent.cpp
@@ -15,7 +15,7 @@
* *
***************************************************************************/
-#include "ConstellationArtComponent.h"
+#include "constellationartcomponent.h"
#include "kstars/auxiliary/ksfilereader.h"
#include "kstars/skymap.h"
#include "kstars/projections/projector.h"
@@ -46,6 +46,8 @@ void ConstellationArtComponent::loadData(){
while ( fileReader.hasMoreLines() ) {
QString line;
+ int rah1,ram1,ras1,dd1,dm1,ds1,rah2,ram2,ras2,dd2,dm2,ds2;
+ QChar sign1,sign2;
line = fileReader.readLine();
if( line.isEmpty() )
@@ -68,23 +70,48 @@ void ConstellationArtComponent::loadData(){
m_ConstList[i]->y2 = line.mid( 22, 3 ).trimmed().toInt();
m_ConstList[i]->hd2 = line.mid( 26, 6 ).trimmed().toInt();
- //Read pixel coordinates and HD number of star 3
- m_ConstList[i]->x3 = line.mid( 33, 3 ).trimmed().toInt();
- m_ConstList[i]->y3 = line.mid( 37, 3 ).trimmed().toInt();
- m_ConstList[i]->hd3 = line.mid( 41, 6 ).trimmed().toInt();
+ //Read J2000 coordinates of Star 1
+ rah1 = line.mid(33,2).trimmed().toInt();
+ ram1 = line.mid(35,2).trimmed().toInt();
+ ras1 = line.mid(37,2).trimmed().toInt();
+ sign1 = line.at(39);
+ dd1 = line.mid(40,2).trimmed().toInt();
+ dm1 = line.mid(42,2).trimmed().toInt();
+ ds1 = line.mid(44,2).trimmed().toInt();
+
+ //Read J2000 coordinates of Star 2
+ rah2 = line.mid(47,2).trimmed().toInt();
+ ram2 = line.mid(49,2).trimmed().toInt();
+ ras2 = line.mid(51,2).trimmed().toInt();
+ sign2 = line.at(53);
+ dd2 = line.mid(54,2).trimmed().toInt();
+ dm2 = line.mid(56,2).trimmed().toInt();
+ ds2 = line.mid(58,2).trimmed().toInt();
+
+ m_ConstList[i]->ra1.setH(rah1,ram1,ras1);
+ m_ConstList[i]->ra2.setH(rah2,ram2,ras2);
+ m_ConstList[i]->dec1 = dms(dd1,dm1,ds1);
+ m_ConstList[i]->dec2 = dms(dd2,dm2,ds2);
+
+ if ( sign1 == '-' )
+ m_ConstList[i]->dec1.setD( -1.0*m_ConstList[i]->dec1.Degrees() );
+
+ if ( sign2 == '-' )
+ m_ConstList[i]->dec2.setD( -1.0*m_ConstList[i]->dec2.Degrees() );
+
+ m_ConstList[i]->star1->setRA0(m_ConstList[i]->ra1);
+ m_ConstList[i]->star2->setRA0(m_ConstList[i]->ra2);
+ m_ConstList[i]->star1->setDec0(m_ConstList[i]->dec1);
+ m_ConstList[i]->star2->setDec0(m_ConstList[i]->dec2);
//Read abbreviation and image file name
- m_ConstList[i]->abbrev = line.mid( 48, 3 );
- m_ConstList[i]->imageFileName = line.mid( 52 ).trimmed();
+ m_ConstList[i]->abbrev = line.mid( 61, 3 );
+ m_ConstList[i]->imageFileName = line.mid( 65 ).trimmed();
//Make a QImage object pointing to constellation image
m_ConstList[i]->constart_image = QImage(m_ConstList[i]->imageFileName,0);
i++;
- //qDebug()<<i;
-
- //qDebug()<< "Serial number:"<<rank<<"x1:"<<x1<<"y1:"<<y1<<"HD1:"<<hd1<<"x2:"<<x2<<"y2:"<<y2<<"HD2:"<<hd2<<"x3:"<<x3<<"y3:"<<y3<<"HD3:"<<hd3<<"abbreviation:"<<abbrev<<"name"<<imageFileName;
- //testing to see if the file opens and outputs the data
}
}
@@ -96,8 +123,6 @@ void ConstellationArtComponent::showList()
qDebug()<<m_ConstList[i]->rank<<m_ConstList[i]->getAbbrev()<<m_ConstList[i]->getImageFileName();
qDebug()<<m_ConstList[i]->getx1()<<m_ConstList[i]->gety1()<<m_ConstList[i]->gethd1();
qDebug()<<m_ConstList[i]->getx2()<<m_ConstList[i]->gety2()<<m_ConstList[i]->gethd2();
- qDebug()<<m_ConstList[i]->getx3()<<m_ConstList[i]->gety3()<<m_ConstList[i]->gethd3();
-
}
}
@@ -117,24 +142,31 @@ void ConstellationArtComponent::drawConstArtImage(SkyPainter *skyp, Constellatio
if(drawFlag==false) return;
SkyMap *map = SkyMap::Instance();
- const Projector *proj = map->projector();
+ //const Projector *proj = map->projector();
KStarsData *data = KStarsData::Instance();
- UpdateID updateID = data->updateID();
+ //UpdateID updateID = data->updateID();
skyp->setBrush( Qt::NoBrush );
- if ( obj->updateID != updateID ) {
- obj->updateID = updateID;
+ //if ( obj->updateID != updateID ) {
+ //obj->updateID = updateID;
int w = obj->imageWidth();
int h = obj->imageHeight();
- QPainter::save();
+ QPointF position1,position2;
+ SkyPoint s1 = obj->getStar1();
+ SkyPoint s2 = obj->getStar2();
+
+ position1 = map->projector()->toScreen(&s1);
+ position2 = map->projector()->toScreen(&s2);
+
+ QPainter painter;
+ painter.save();
//How do I define position to translate?
- QPainter::translate(pos);
- QPainter::drawImage( QRect(-0.5*w, -0.5*h, w, h), obj->image() );
- QPainter::restore();
+ painter.translate(position1);
+ painter.drawImage( QRect(-0.5*w, -0.5*h, w, h), obj->image() );
+ painter.restore();
- }
}
diff --git a/kstars/skycomponents/constellationartcomponent.h b/kstars/skycomponents/constellationartcomponent.h
index d3fe7f8..518321f 100644
--- a/kstars/skycomponents/constellationartcomponent.h
+++ b/kstars/skycomponents/constellationartcomponent.h
@@ -21,7 +21,7 @@
#include "kstars/skyobjects/constellationsart.h"
#include "skycomponent.h"
#include <QImage>
-
+#include "kstars/auxiliary/dms.h"
class ConstellationsArt;
class QColor;
class SkyMap;
@@ -29,6 +29,9 @@ class SkyPoint;
class SkyMesh;
class QImage;
class QPainter;
+class dms;
+class Projector;
+class QPainter;
class ConstellationArtComponent : public SkyComponent
{
@@ -50,7 +53,8 @@ public:
virtual void draw( SkyPainter *skyp );
- QList<ConstellationsArt*> m_ConstList;
+ QVector<ConstellationsArt*> m_ConstList;
+
private:
diff --git a/kstars/skycomponents/skymapcomposite.cpp b/kstars/skycomponents/skymapcomposite.cpp
index 9e2aa2b..f801a27 100644
--- a/kstars/skycomponents/skymapcomposite.cpp
+++ b/kstars/skycomponents/skymapcomposite.cpp
@@ -26,7 +26,7 @@
#include "skyobjects/starobject.h"
#include "skyobjects/deepskyobject.h"
#include "skyobjects/ksplanet.h"
-#include "constellationsart.h"
+#include "kstars/skyobjects/constellationsart.h"
#include "targetlistcomponent.h"
#include "constellationboundarylines.h"
@@ -47,7 +47,7 @@
#include "flagcomponent.h"
#include "satellitescomponent.h"
#include "supernovaecomponent.h"
-#include "ConstellationArtComponent.h"
+#include "constellationartcomponent.h"
#include "skymesh.h"
diff --git a/kstars/skyobjects/constellationsart.cpp b/kstars/skyobjects/constellationsart.cpp
index 6b4e583..9b1a206 100644
--- a/kstars/skyobjects/constellationsart.cpp
+++ b/kstars/skyobjects/constellationsart.cpp
@@ -31,13 +31,10 @@ ConstellationsArt::ConstellationsArt(const ConstellationsArt &o){
x1 = o.getx1();
x2 = o.getx2();
- x3 = o.getx3();
y1 = o.gety1();
y2 = o.gety2();
- y3 = o.gety3();
hd1 = o.gethd1();
hd2 = o.gethd2();
- hd3 = o.gethd3();
abbrev = o.getAbbrev();
imageFileName = o.getImageFileName();
constart_image = o.image();
diff --git a/kstars/skyobjects/constellationsart.h b/kstars/skyobjects/constellationsart.h
index 8451ed6..702d214 100644
--- a/kstars/skyobjects/constellationsart.h
+++ b/kstars/skyobjects/constellationsart.h
@@ -25,9 +25,13 @@
#include "culturelist.h"
#include "kstars/skypainter.h"
#include "kstars/skyobjects/skyobject.h"
-#include "ConstellationArtComponent.h"
+#include "kstars/skycomponents/constellationartcomponent.h"
+#include "skypoint.h"
+#include "kstars/auxiliary/dms.h"
class QImage;
+class SkyPoint;
+class dms;
/** @class ConstellationsArt
* @short Represents images for sky cultures
@@ -40,8 +44,11 @@ class ConstellationsArt: public SkyObject{
private:
QString abbrev, imageFileName;
- int x1,y1,x2,y2,x3,y3,hd1,hd2,hd3,rank;
+ int x1,y1,x2,y2,hd1,hd2,rank;
QImage constart_image;
+ SkyPoint *star1;
+ SkyPoint *star2;
+ dms ra1,dec1,ra2,dec2;
public:
@@ -61,6 +68,12 @@ public:
//Destructor
virtual ~ConstellationsArt();
+ //Return Star 1 skypoint
+ SkyPoint getStar1(){return *star1;}
+
+ //Return Star 2 skypoint
+ SkyPoint getStar2(){return *star2;}
+
/** @return an object's image */
const QImage& image() const { return constart_image; }
@@ -91,23 +104,14 @@ public:
/** @return an object's y2 */
inline int gety2() const { return y2; }
- /** @return an object's x3 */
- inline int getx3() const { return x3; }
-
- /** @return an object's y3 */
- inline int gety3() const { return y3; }
-
/** @return an object's hd1 */
inline int gethd1() const { return hd1; }
/** @return an object's hd2 */
inline int gethd2() const { return hd2; }
- /** @return an object's hd3 */
- inline int gethd3() const { return hd3; }
-
//UpdateID which would be compared with the global updateID to know when to redraw a skyobject in a draw cycle
- static quint64 updateID;
+ //static quint64 updateID;
};
#endif // CONSTELLATIONSART_H