[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeedu/kstars/kstars
From: Akarsh Simha <akarshsimha () gmail ! com>
Date: 2010-10-15 6:35:53
Message-ID: 20101015063553.63098AC897 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1186056 by asimha:
The Observing List is now drawn using a TargetListComponent rather
than being drawn in a method within SkyMap, as an overlay.
M +1 -0 CMakeLists.txt
M +10 -0 skycomponents/skymapcomposite.cpp
M +2 -0 skycomponents/skymapcomposite.h
M +0 -6 skymap.h
M +0 -38 skymapdraw.cpp
--- trunk/KDE/kdeedu/kstars/kstars/CMakeLists.txt #1186055:1186056
@@ -204,6 +204,7 @@
skycomponents/starblockfactory.cpp
skycomponents/culturelist.cpp
skycomponents/flagcomponent.cpp
+ skycomponents/targetlistcomponent.cpp
)
set(libkstarswidgets_SRCS
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.cpp #1186055:1186056
@@ -27,6 +27,7 @@
#include "skyobjects/deepskyobject.h"
#include "skyobjects/ksplanet.h"
+#include "targetlistcomponent.h"
#include "constellationboundarylines.h"
#include "constellationlines.h"
#include "culturelist.h"
@@ -44,9 +45,12 @@
#include "satellitecomposite.h"
#include "flagcomponent.h"
+
#include "skymesh.h"
#include "skylabeler.h"
+#include "typedef.h"
+
SkyMapComposite::SkyMapComposite(SkyComposite *parent ) :
SkyComposite(parent), m_reindexNum( J2000 )
{
@@ -88,6 +92,9 @@
addComponent( m_SolarSystem = new SolarSystemComposite( this ));
addComponent( m_Flags = new FlagComponent( this ));
+ addComponent( m_ObservingList = new TargetListComponent( this , \
&KStars::Instance()->observingList()->sessionList(), QPen(), + \
&Options::obsListSymbol, &Options::obsListText ) ); +
connect( this, SIGNAL( progressText( const QString & ) ),
KStarsData::Instance(), SIGNAL( progressText( const QString & ) ) );
}
@@ -231,6 +238,9 @@
m_Flags->draw( psky );
+ m_ObservingList->pen = QPen( QColor(data->colorScheme()->colorNamed( \
"ObsListColor" )), int(SkyMap::Instance()->scale()) ); + m_ObservingList->draw( \
psky ); +
m_skyMesh->inDraw( false );
//kDebug() << QString("draw took %1 ms").arg( t.elapsed() );
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.h #1186055:1186056
@@ -44,6 +44,7 @@
class StarComponent;
class DeepStarComponent;
class SatelliteComposite;
+class TargetListComponent;
class DeepSkyObject;
class KSPlanetBase;
@@ -207,6 +208,7 @@
StarComponent *m_Stars;
SatelliteComposite *m_Satellites;
FlagComponent *m_Flags;
+ TargetListComponent *m_ObservingList;
SkyMesh* m_skyMesh;
SkyLabeler* m_skyLabeler;
--- trunk/KDE/kdeedu/kstars/kstars/skymap.h #1186055:1186056
@@ -661,12 +661,6 @@
void drawTelescopeSymbols(QPainter &psky);
/**
- *@short Draw symbols for objects in the observing list.
- *@param psky reference to the QPainter on which to draw (this should be the sky \
pixmap)
- */
- void drawObservingList( QPainter &psky );
-
- /**
*@short Draw a dotted-line rectangle which traces the potential new \
field-of-view in ZoomBox mode.
*@param psky reference to the QPainter on which to draw (this should be the Sky \
pixmap).
*/
--- trunk/KDE/kdeedu/kstars/kstars/skymapdraw.cpp #1186055:1186056
@@ -137,7 +137,6 @@
fov->draw(p, Options::zoomFactor());
}
drawTelescopeSymbols( p );
- drawObservingList( p );
drawZoomBox( p );
if ( transientObject() )
@@ -358,42 +357,6 @@
transientObject()->drawRudeNameLabel( p, o );
}
-void SkyMap::drawObservingList( QPainter &psky ) {
- int penWidth = int(m_Scale);
- psky.setPen( QPen( QColor( data->colorScheme()->colorNamed( "ObsListColor" ) ), \
penWidth ) );
-
- KStars* kstars = KStars::Instance();
- if ( kstars && kstars->observingList()->sessionList().size() ) {
- foreach ( SkyObject* obj, kstars->observingList()->sessionList() ) {
- if ( checkVisibility( obj ) ) {
- QPointF o = toScreen( obj );
-
- // label object if it is currently on screen
- if (o.x() >= 0. && o.x() <= width()*m_Scale && o.y() >=0. && o.y() \
<= height()*m_Scale ) {
- if ( Options::obsListSymbol() ) {
- if ( Options::useAntialias() ) {
- float size = 20.*m_Scale;
- float x1 = o.x() - 0.5*size;
- float y1 = o.y() - 0.5*size;
- psky.drawArc( QRectF(x1, y1, size, size), -60*16, 120*16 \
);
- psky.drawArc( QRectF(x1, y1, size, size), 120*16, 120*16 \
);
- } else {
- int size = 20*int(m_Scale);
- int x1 = int(o.x()) - size/2;
- int y1 = int(o.y()) - size/2;
- psky.drawArc( QRect(x1, y1, size, size), -60*16, 120*16 \
);
- psky.drawArc( QRect(x1, y1, size, size), 120*16, 120*16 \
);
- }
- }
- if ( Options::obsListText() ) {
- obj->drawRudeNameLabel( psky, o );
- }
- }
- }
- }
- }
-}
-
void SkyMap::drawTelescopeSymbols(QPainter &psky)
{
#ifdef HAVE_INDI_H
@@ -562,7 +525,6 @@
if ( x1 || y1 ) p.translate( x1, y1 );
data->skyComposite()->draw( p );
- drawObservingList( p );
p.end();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic