[Kstars-devel] KDE/kdeedu/kstars/kstars
Alexey Khudyakov
alexey.skladnoy at gmail.com
Wed Jul 29 13:02:32 CEST 2009
SVN commit 1004093 by khudyakov:
Add number to asteriod data. They are used in UID implemetation
CCMAIL: kstars-devel at kde.org
M +3 -3 skycomponents/asteroidscomponent.cpp
M +4 -7 skyobjects/ksasteroid.cpp
M +4 -2 skyobjects/ksasteroid.h
M +1 -1 skyobjects/kspluto.cpp
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/asteroidscomponent.cpp #1004092:1004093
@@ -63,9 +63,9 @@
emitProgressText( i18n("Loading asteroids") );
while( fileReader.hasMoreLines() ) {
- KSAsteroid *ast = 0;
line = fileReader.readLine();
+ int catN = line.mid(0,6).toInt();
name = line.mid( 6, 17 ).trimmed();
mJD = line.mid( 24, 5 ).toInt();
a = line.mid( 30, 9 ).toDouble();
@@ -79,8 +79,8 @@
JD = double( mJD ) + 2400000.5;
- ast = new KSAsteroid( name, QString(), JD, a, e, dms(dble_i),
- dms(dble_w), dms(dble_N), dms(dble_M), H, G );
+ KSAsteroid *ast = new KSAsteroid( catN, name, QString(), JD, a, e, dms(dble_i),
+ dms(dble_w), dms(dble_N), dms(dble_M), H, G );
ast->setAngularSize( 0.005 );
objectList().append( ast );
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/ksasteroid.cpp #1004092:1004093
@@ -24,14 +24,12 @@
#include "ksutils.h"
#include "kstarsdata.h"
-KSAsteroid::KSAsteroid( const QString &s, const QString &imfile,
+KSAsteroid::KSAsteroid( int _catN, const QString &s, const QString &imfile,
long double _JD, double _a, double _e, dms _i, dms _w, dms _Node, dms _M, double _H, double _G )
: KSPlanetBase(s, imfile),
- JD(_JD), a(_a), e(_e), i(_i), w(_w), M(_M), N(_Node), H(_H), G(_G)
+ catN(_catN), JD(_JD), a(_a), e(_e), i(_i), w(_w), M(_M), N(_Node), H(_H), G(_G)
{
- setType( 10 ); //Asteroid
- this -> H = H;
- this -> G = G;
+ setType( SkyObject::ASTEROID );
//Compute the orbital Period from Kepler's 3rd law:
P = 365.2568984 * pow(a, 1.5); //period in days
}
@@ -144,6 +142,5 @@
SkyObject::UID KSAsteroid::getUID() const
{
- // FIXME: return sensible number. Asteriod number required.
- return SkyObject::invalidUID;
+ return solarsysUID(UID_SOL_ASTEROID) | catN;
}
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/ksasteroid.h #1004092:1004093
@@ -50,7 +50,8 @@
public:
/**Constructor.
- *@p s the name of the asteroid
+ *@p catN number of asteroid
+ *@p s the name of the asteroid
*@p image_file the filename for an image of the asteroid
*@p JD the Julian Day for the orbital elements
*@p a the semi-major axis of the asteroid's orbit (AU)
@@ -62,7 +63,7 @@
*@p H absolute magnitude
*@p G slope parameter
*/
- KSAsteroid( const QString &s, const QString &image_file,
+ KSAsteroid( int catN, const QString &s, const QString &image_file,
long double JD, double a, double e, dms i, dms w, dms N, dms M, double H, double G );
virtual KSAsteroid* clone() const;
@@ -105,6 +106,7 @@
private:
virtual void findMagnitude(const KSNumbers*);
+ int catN;
long double JD;
double a, e, P;
dms i, w, M, N;
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/kspluto.cpp #1004092:1004093
@@ -33,7 +33,7 @@
#endif
KSPluto::KSPluto(const QString &fn, double pSize )
- : KSAsteroid( i18n("Pluto"), fn, J2000,
+ : KSAsteroid( 0, i18n("Pluto"), fn, J2000,
39.48168677, 0.24880766, dms(17.14175), dms(113.76329),
dms(110.30347), dms(14.86205), 1.0, 0.0 )
{
More information about the Kstars-devel
mailing list