summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelarkode Suresh Adityan <[email protected]>2015-06-27 13:11:00 +0530
committerMelarkode Suresh Adityan <[email protected]>2015-06-27 13:11:00 +0530
commit5ee21cf5bc9a6adfe27f91bda265e7599af658e0 (patch)
tree42a078770452840c2c09d4bf4ade1cf817dcd375
parentc5517ee900a49548c32c437d502a205e6be0633c (diff)
Review commit for Jasem.
-rw-r--r--kstars/skycomponents/constellationartcomponent.cpp22
-rw-r--r--kstars/skycomponents/constellationartcomponent.h2
-rw-r--r--kstars/skycomponents/skymapcomposite.cpp4
-rw-r--r--kstars/skyobjects/constellationsart.h9
4 files changed, 21 insertions, 16 deletions
diff --git a/kstars/skycomponents/constellationartcomponent.cpp b/kstars/skycomponents/constellationartcomponent.cpp
index 5533989..64cfcb0 100644
--- a/kstars/skycomponents/constellationartcomponent.cpp
+++ b/kstars/skycomponents/constellationartcomponent.cpp
@@ -95,9 +95,9 @@ void ConstellationArtComponent::showList()
void ConstellationArtComponent::draw(SkyPainter *skyp){
int i = 0;
- for(i=0; i < m_ConstList.size(); i++){
+ //(i=0; i < m_ConstList.size(); i++){
drawConstArtImage( skyp, m_ConstList[i], true);
- }
+ //}
//Loops through the QList containing all data required to draw western constellations.
//There are 85 images, so m_ConstList.size() should return 85.
}
@@ -106,13 +106,14 @@ void ConstellationArtComponent::draw(SkyPainter *skyp){
void ConstellationArtComponent::drawConstArtImage(SkyPainter *skyp, ConstellationsArt *obj, bool drawFlag)
{
if(drawFlag==false) return;
-QMessageBox::information(NULL, "Error", "before skymap");
SkyMap *map = SkyMap::Instance();
const Projector *proj = map->projector();
skyp->setBrush( Qt::NoBrush );
- SkyPoint s1 = obj->getStar1();
- SkyPoint s2 = obj->getStar2();
+ SkyPoint *s1 = new SkyPoint;
+ SkyPoint *s2 = new SkyPoint;
+ s1 = obj->star1;
+ s2 = obj->star2;
int w = obj->imageWidth();
int h = obj->imageHeight();
@@ -121,11 +122,11 @@ QMessageBox::information(NULL, "Error", "before skymap");
//if ( obj->updateID != updateID ) {
//obj->updateID = updateID;
- if( (proj->checkVisibility(&s1)==true) && (proj->checkVisibility(&s2)==true) ){
-
+ if( (proj->checkVisibility(s1)==true) && (proj->checkVisibility(s2)==true) ){
//Draw Image
- QPointF position1 = map->projector()->toScreen(&s1);
- QPointF position2 = map->projector()->toScreen(&s2);
+
+ QPointF position1 = map->projector()->toScreen(s1);
+ QPointF position2 = map->projector()->toScreen(s2);
QPainter painter;
painter.save();
@@ -133,6 +134,7 @@ QMessageBox::information(NULL, "Error", "before skymap");
painter.translate(position1);
painter.drawImage( QRect(-0.5*w, -0.5*h, w, h), obj->image() );
painter.restore();
+ painter.end();
- }
+ }
}
diff --git a/kstars/skycomponents/constellationartcomponent.h b/kstars/skycomponents/constellationartcomponent.h
index 1db390c..7fc2354 100644
--- a/kstars/skycomponents/constellationartcomponent.h
+++ b/kstars/skycomponents/constellationartcomponent.h
@@ -26,6 +26,7 @@
#include "kstars/auxiliary/dms.h"
#include <QGraphicsPixmapItem>
#include <QGraphicsView>
+#include "kstars/skymap.h"
class ConstellationsArt;
class QColor;
class SkyMap;
@@ -39,6 +40,7 @@ class QPainter;
class QSqlDatabase;
class QGraphicsPixmapItem;
class QGraphicsView;
+class SkyMap;
class ConstellationArtComponent : public SkyComponent
{
diff --git a/kstars/skycomponents/skymapcomposite.cpp b/kstars/skycomponents/skymapcomposite.cpp
index f801a27..218ba0b 100644
--- a/kstars/skycomponents/skymapcomposite.cpp
+++ b/kstars/skycomponents/skymapcomposite.cpp
@@ -515,12 +515,12 @@ void SkyMapComposite::reloadCNames( ) {
m_CNames = new ConstellationNamesComponent( this, m_Cultures );
}
-void SkyMapComposite::reloadConstArt(){
+/*void SkyMapComposite::reloadConstArt(){
Q_ASSERT( !SkyMapDrawAbstract::drawLock() );
SkyMapDrawAbstract::setDrawLock( true );
delete m_ConstArt;
m_ConstArt = new ConstellationArtComponent( this );
-}
+}*/
void SkyMapComposite::reloadDeepSky() {
Q_ASSERT( !SkyMapDrawAbstract::drawLock() );
diff --git a/kstars/skyobjects/constellationsart.h b/kstars/skyobjects/constellationsart.h
index c99d252..3a9c76b 100644
--- a/kstars/skyobjects/constellationsart.h
+++ b/kstars/skyobjects/constellationsart.h
@@ -44,11 +44,12 @@ private:
QString abbrev, imageFileName;
int x1,y1,x2,y2,hd1,hd2;
QImage constart_image;
- SkyPoint* star1;
- SkyPoint* star2;
public:
+ SkyPoint* star1;
+ SkyPoint* star2;
+
/**
*Constructor. Set SkyObject data according to arguments.
*@param t Type of object
@@ -66,10 +67,10 @@ public:
~ConstellationsArt();
//Return Star 1 skypoint
- SkyPoint getStar1(){return *star1;}
+ //SkyPoint& getStar1(){return star1;}
//Return Star 2 skypoint
- SkyPoint getStar2(){return *star2;}
+ //SkyPoint& getStar2(){return star2;}
/** @return an object's image */
const QImage& image() const { return constart_image; }