• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • skyobjects
starobject.h
Go to the documentation of this file.
1 /***************************************************************************
2  starobject.h - K Desktop Planetarium
3  -------------------
4  begin : Tue Sep 18 2001
5  copyright : (C) 2001 by Thomas Kabelmann
6  email : tk78@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef STAROBJECT_H_
19 #define STAROBJECT_H_
20 
21 #include <QMap>
22 #include <QPixmap>
23 
24 #include "skyobject.h"
25 #include "stardata.h"
26 #include "deepstardata.h"
27 
28 class KSPopupMenu;
29 class KStarsData;
30 
41 class StarObject : public SkyObject
42 {
43 public:
44 
49  static double reindexInterval( double pm );
50 
67  explicit StarObject( dms r=dms(0.0), dms d=dms(0.0), float m=0.0, const QString &n=QString(),
68  const QString &n2=QString(), const QString &sptype="--", double pmra=0.0, double pmdec=0.0,
69  double par=0.0, bool mult=false, bool var=false, int hd=0 );
86  StarObject( double r, double d, float m=0.0, const QString &n=QString(),
87  const QString &n2=QString(), const QString &sptype="--", double pmra=0.0, double pmdec=0.0,
88  double par=0.0, bool mult=false, bool var=false, int hd=0 );
89 
90  virtual StarObject* clone() const;
91  virtual UID getUID() const;
92 
94  StarObject(const StarObject& o);
95 
97  ~StarObject() { }
98 
109  void init( const starData *stardata );
110 
117  void init( const deepStarData *stardata );
118 
125  void setNames( QString name, QString name2 );
126 
128  inline bool hasName() const { return ( !Name.isEmpty() && Name!=starString ); }
129 
131  inline virtual QString name( void ) const { return hasName() ? Name : starString;}
132 
134  inline virtual QString longname( void ) const { return hasLongName() ? LongName : starString; }
135 
139  QString sptype( void ) const;
140 
142  char spchar() const;
143 
147  QString gname( bool useGreekChars=true ) const;
148 
153  QString greekLetter( bool useGreekChars=true ) const;
154 
156  QString constell( void ) const;
157 
166  virtual void updateCoords( KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0, bool forceRecompute = false );
167 
168  /* @short fills ra and dec with the coordinates of the star with the proper
169  * motion correction but without precesion and its friends. It is used
170  * in StarComponent to re-index all the stars.
171  *
172  * NOTE: ra and dec both in degrees.
173  */
174  void getIndexCoords( KSNumbers *num, double *ra, double *dec );
175 
177  void JITupdate();
178 
180  inline double pmMagnitude()
181  {
182  double cosDec = dec0().cos();
183  return sqrt( cosDec * cosDec * pmRA() * pmRA() + pmDec() * pmDec() );
184  }
185 
190  inline double pmMagnitudeSquared()
191  {
192  double metric_weighted_pmRA = dec0().cos() * pmRA();
193  return (metric_weighted_pmRA * metric_weighted_pmRA + pmDec() * pmDec());
194  }
195 
201  inline void setProperMotion( double pmra, double pmdec ) { PM_RA = pmra; PM_Dec = pmdec; }
202 
204  inline double pmRA() const { return PM_RA; }
205 
207  inline double pmDec() const { return PM_Dec; }
208 
210  inline void setParallax( double plx ) { Parallax = plx; }
211 
213  inline double parallax() const { return Parallax; }
214 
216  inline double distance() const { return 1000./parallax(); }
217 
220  inline void setMultiple( bool m ) { Multiplicity = m; }
221 
223  inline bool isMultiple() const { return Multiplicity; }
224 
226  inline int getHDIndex() const { return HD; }
227 
231  inline void setVariable( bool v ) { Variability = v; }
232 
235  inline bool isVariable() const { return Variability; }
236 
237  /* @short returns the name, the magnitude or both.
238  */
239  QString nameLabel( bool drawName, bool drawMag ) const;
240 
241  virtual QString labelString() const;
242 
247  virtual double labelOffset() const;
248 
252  inline float getVMag() const { return V; }
253 
257  inline float getBMag() const { return B; }
258 
263  inline float getBVIndex() const { return ( ( B < 30.0 && V < 30.0 ) ? B - V : 99.9 ); }
264 
265  quint64 updateID;
266  quint64 updateNumID;
267 
268 protected:
269  // DEBUG EDIT. For testing proper motion, uncomment this, and related blocks
270  // See starobject.cpp for further info.
271  // static QVector<SkyPoint *> Trail;
272  // bool testStar;
273  // END DEBUG
274 
275 private:
276  virtual void initPopupMenu( KSPopupMenu *pmenu);
277 
278  char SpType[2];
279 
280  double PM_RA, PM_Dec, Parallax; //, VRange, VPeriod;
281  bool Multiplicity, Variability;
282  int HD;
283  float B, V; // B and V magnitudes, separately. NOTE 1) This is kept separate from mag for a reason. See init( const deepStarData *); 2) This applies only to deep stars at the moment
284 };
285 
286 #endif
StarObject::~StarObject
~StarObject()
Destructor.
Definition: starobject.h:97
deepStarData
Structure that holds star data for really faint stars.
Definition: deepstardata.h:28
SkyPoint::ra
const dms & ra() const
Definition: skypoint.h:171
StarObject::setMultiple
void setMultiple(bool m)
set the star's multiplicity flag (i.e., is it a binary or multiple star?)
Definition: starobject.h:220
starData
Structure that holds star data.
Definition: stardata.h:28
SkyPoint::dec0
const dms & dec0() const
Definition: skypoint.h:168
StarObject::JITupdate
void JITupdate()
added for JIT updates from both StarComponent and ConstellationLines
Definition: starobject.cpp:317
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
StarObject::reindexInterval
static double reindexInterval(double pm)
returns the reindex interval (in centuries!) for the given magnitude of proper motion (in milliarcsec...
Definition: starobject.cpp:49
KSPopupMenu
The KStars Popup Menu.
Definition: kspopupmenu.h:43
SkyObject::LongName
QString LongName
Definition: skyobject.h:425
StarObject::pmMagnitudeSquared
double pmMagnitudeSquared()
returns the square of the magnitude of the proper motion correction in (milliarcsec/year)^2 ...
Definition: starobject.h:190
StarObject::getBVIndex
float getBVIndex() const
Definition: starobject.h:263
StarObject::sptype
QString sptype(void) const
Returns entire spectral type string.
Definition: starobject.cpp:340
StarObject::getVMag
float getVMag() const
Definition: starobject.h:252
skyobject.h
deepstardata.h
StarObject::updateCoords
virtual void updateCoords(KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0, bool forceRecompute=false)
Determine the current coordinates (RA, Dec) from the catalog coordinates (RA0, Dec0), accounting for both precession and nutation.
Definition: starobject.cpp:244
StarObject::labelOffset
virtual double labelOffset() const
Definition: starobject.cpp:518
StarObject::setParallax
void setParallax(double plx)
set the star's parallax angle, in milliarcsec
Definition: starobject.h:210
StarObject::setNames
void setNames(QString name, QString name2)
Sets the name, genetive name, and long name.
Definition: starobject.cpp:225
StarObject::greekLetter
QString greekLetter(bool useGreekChars=true) const
Returns the greek letter portion of the star's genetive name.
Definition: starobject.cpp:356
StarObject::setProperMotion
void setProperMotion(double pmra, double pmdec)
Set the Ra and Dec components of the star's proper motion, in milliarcsec/year.
Definition: starobject.h:201
StarObject::getUID
virtual UID getUID() const
Return UID for object.
Definition: starobject.cpp:522
StarObject::getIndexCoords
void getIndexCoords(KSNumbers *num, double *ra, double *dec)
Definition: starobject.cpp:268
StarObject::getBMag
float getBMag() const
Definition: starobject.h:257
stardata.h
StarObject::updateID
quint64 updateID
Definition: starobject.h:265
StarObject::distance
double distance() const
Definition: starobject.h:216
SkyObject::starString
static QString starString
Definition: skyobject.h:434
StarObject::updateNumID
quint64 updateNumID
Definition: starobject.h:266
StarObject::getHDIndex
int getHDIndex() const
Definition: starobject.h:226
StarObject::isMultiple
bool isMultiple() const
Definition: starobject.h:223
StarObject::constell
QString constell(void) const
Definition: starobject.cpp:394
SkyObject::UID
qint64 UID
Type for Unique object IDenticator.
Definition: skyobject.h:53
SkyObject::hasLongName
bool hasLongName() const
Definition: skyobject.h:272
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
SkyPoint::dec
const dms & dec() const
Definition: skypoint.h:174
StarObject::spchar
char spchar() const
Returns just the first character of the spectral type string.
Definition: starobject.cpp:344
SkyObject::name2
QString name2(void) const
Definition: skyobject.h:132
StarObject::parallax
double parallax() const
Definition: starobject.h:213
StarObject::pmMagnitude
double pmMagnitude()
returns the magnitude of the proper motion correction in milliarcsec/year
Definition: starobject.h:180
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
NaN::d
const double d
Definition: nan.h:35
StarObject::pmDec
double pmDec() const
Definition: starobject.h:207
StarObject::init
void init(const starData *stardata)
Initializes a StarObject to given data.
Definition: starobject.cpp:133
StarObject::isVariable
bool isVariable() const
Definition: starobject.h:235
StarObject::labelString
virtual QString labelString() const
Definition: starobject.cpp:514
StarObject::hasName
bool hasName() const
Definition: starobject.h:128
StarObject::StarObject
StarObject(dms r=dms(0.0), dms d=dms(0.0), float m=0.0, const QString &n=QString(), const QString &n2=QString(), const QString &sptype="--", double pmra=0.0, double pmdec=0.0, double par=0.0, bool mult=false, bool var=false, int hd=0)
Constructor.
Definition: starobject.cpp:59
SkyObject::Name
QString Name
Definition: skyobject.h:425
StarObject::setVariable
void setVariable(bool v)
set the star's variability flag
Definition: starobject.h:231
StarObject::longname
virtual QString longname(void) const
If star is unnamed return "star" otherwise return the longname.
Definition: starobject.h:134
StarObject::pmRA
double pmRA() const
Definition: starobject.h:204
StarObject::clone
virtual StarObject * clone() const
Create copy of object.
Definition: starobject.cpp:128
StarObject::name
virtual QString name(void) const
If star is unnamed return "star" otherwise return the name.
Definition: starobject.h:131
StarObject::gname
QString gname(bool useGreekChars=true) const
Returns the genetive name of the star.
Definition: starobject.cpp:349
StarObject
This is a subclass of SkyObject.
Definition: starobject.h:41
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
StarObject::nameLabel
QString nameLabel(bool drawName, bool drawMag) const
Definition: starobject.cpp:493
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal