[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kstars/gsoc2012-spacetime] kstars/skycomponents: More cleanup in supporting classes
From: Rishab Arora <ra.rishab () gmail ! com>
Date: 2012-09-01 0:00:50
Message-ID: 20120901000050.7F7D4A60C8 () git ! kde ! org
[Download RAW message or body]
Git commit 424470132ae8cce7eef786dab2192a4d6da84eee by Rishab Arora.
Committed on 23/08/2012 at 20:04.
Pushed by rishabarora into branch 'gsoc2012-spacetime'.
More cleanup in supporting classes
M +21 -26 kstars/skycomponents/catalogcomponent.cpp
M +7 -18 kstars/skycomponents/catalogcomponent.h
http://commits.kde.org/kstars/424470132ae8cce7eef786dab2192a4d6da84eee
diff --git a/kstars/skycomponents/catalogcomponent.cpp \
b/kstars/skycomponents/catalogcomponent.cpp index 51092f6..cdaa6bc 100644
--- a/kstars/skycomponents/catalogcomponent.cpp
+++ b/kstars/skycomponents/catalogcomponent.cpp
@@ -17,38 +17,36 @@
#include "catalogcomponent.h"
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
#include <QDir>
#include <QFile>
#include <QPixmap>
#include <QTextStream>
-#include <kdebug.h>
-#include <klocale.h>
-#include <kmessagebox.h>
-
-#include "Options.h"
-#include "kstarsdata.h"
-#include "skymap.h"
+#include "kstars/Options.h"
+#include "kstars/kstarsdata.h"
+#include "kstars/skymap.h"
#include "skyobjects/starobject.h"
#include "skyobjects/deepskyobject.h"
-#include "skypainter.h"
+#include "kstars/skypainter.h"
-QStringList CatalogComponent::m_Columns = QString( "ID RA Dc Tp Nm Mg Flux Mj Mn PA \
Ig" ).split( ' ', QString::SkipEmptyParts ); +QStringList CatalogComponent::m_Columns
+ = QString( "ID RA Dc Tp Nm Mg Flux Mj Mn PA Ig" )
+ .split( ' ',QString::SkipEmptyParts );
-CatalogComponent::CatalogComponent(SkyComposite *parent, const QString &catname, \
bool showerrs, int index) :
- ListComponent(parent),
- m_catName( catname ),
- m_Showerrs( showerrs ),
- m_ccIndex(index)
-{
+CatalogComponent::CatalogComponent(SkyComposite *parent,
+ const QString &catname,
+ bool showerrs, int index)
+ : ListComponent(parent), m_catName(catname),
+ m_Showerrs(showerrs), m_ccIndex(index) {
loadData();
}
-CatalogComponent::~CatalogComponent()
-{
+CatalogComponent::~CatalogComponent() {
}
-void CatalogComponent::loadData()
-{
+void CatalogComponent::loadData() {
emitProgressText( i18n("Loading custom catalog: %1", m_catName ) );
QMap <int, QString> names;
@@ -71,8 +69,7 @@ void CatalogComponent::loadData()
}
-void CatalogComponent::update( KSNumbers * )
-{
+void CatalogComponent::update( KSNumbers * ) {
if ( selected() ) {
KStarsData *data = KStarsData::Instance();
foreach ( SkyObject *obj, m_ObjectList ) {
@@ -105,8 +102,7 @@ void CatalogComponent::update( KSNumbers * )
}
}
-void CatalogComponent::draw( SkyPainter *skyp )
-{
+void CatalogComponent::draw( SkyPainter *skyp ) {
if ( ! selected() ) return;
skyp->setBrush( Qt::NoBrush );
@@ -129,13 +125,12 @@ void CatalogComponent::draw( SkyPainter *skyp )
//PA for Deep-Sky objects is 90 + PA because major axis is horizontal at \
PA=0 //double pa = 90. + map->findPA( dso, o.x(), o.y() );
DeepSkyObject *dso = (DeepSkyObject*)obj;
- skyp->drawDeepSkyObject(dso,true);
+ skyp->drawDeepSkyObject(dso, true);
}
}
}
-bool CatalogComponent::selected()
-{
+bool CatalogComponent::selected() {
if (Options::showCatalogNames().contains(m_catName))
return true;
return false;
diff --git a/kstars/skycomponents/catalogcomponent.h \
b/kstars/skycomponents/catalogcomponent.h index 99ec326..3bcb58d 100644
--- a/kstars/skycomponents/catalogcomponent.h
+++ b/kstars/skycomponents/catalogcomponent.h
@@ -46,6 +46,7 @@ public:
*@p parent Pointer to the parent SkyComposite object
*/
CatalogComponent( SkyComposite*, const QString &fname, bool showerrs, int index \
); +
/**
*@short Destructor. Delete list members
*/
@@ -107,25 +108,13 @@ private:
bool processCustomDataLine(int lnum, const QStringList &d, const QStringList \
&Columns, bool showerrs, QStringList &errs);
-// /**
-// *@short Read metadata about the catalog from its header
-// *@details The method processes the first few lines that denote the
-// * Name, Prefix, Color and Epoch as well as the comment with the
-// * column structure.
-// *@p lines QStringlist containing all of the lines in the custom catalog file
-// *@p Columns QStringList containing the column descriptors (created by this \
function)
-// *@p CatalogName The name of the catalog, as read from the header by this \
function
-// *@p CatalogPrefix The prefix string for naming objects in this catalog (read \
by this function)
-// *@p CatalogColor The color for drawing symbols of objects in this catalog \
(read by this function)
-// *@p CatalogEpoch The coordinate epoch for the catalog (read by this \
function)
-// *@p iStart The line number of the first non-header line in the data file \
(determined by this function)
-// *@p showerrs if true, parse errors will be logged and reported
-// *@p errs reference to the string list containing the parse errors \
encountered
-// */
-// static bool parseCustomDataHeader( const QStringList &lines, QStringList \
&Columns,
-// int &iStart, bool showerrs, QStringList \
&errs);
-
+ /**
+ * @brief Returns true if this catalog is to be drawn
+ * Overriden from SkyComponent::selected
+ * @return bool
+ **/
bool selected();
+
QString m_catName, m_catPrefix, m_catColor, m_catFluxFreq, m_catFluxUnit;
float m_catEpoch;
bool m_Showerrs;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic