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

kstars

KSPlanetBase Class Reference

A subclass of TrailObject that provides additional information needed for most solar system objects. More...

#include <ksplanetbase.h>

Inheritance diagram for KSPlanetBase:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Planets {
  MERCURY = 0, VENUS = 1, MARS = 2, JUPITER = 3,
  SATURN = 4, URANUS = 5, NEPTUNE = 6, PLUTO = 7,
  SUN = 8, MOON = 9, UNKNOWN_PLANET
}

Public Member Functions

 KSPlanetBase (const QString &s=i18n("unnamed"), const QString &image_file=QString(), const QColor &c=Qt::white, double pSize=0)
virtual ~KSPlanetBase ()
double angSize () const
QColor & color ()
const dms * ecLat (void) const
void EclipticToEquatorial (const dms *Obliquity)
const dms * ecLong (void) const
void EquatorialToEcliptic (const dms *Obliquity)
void findPosition (const KSNumbers *num, const dms *lat=0, const dms *LST=0, const KSPlanetBase *Earth=0)
const dms * helEcLat (void) const
const dms * helEcLong (void) const
QImage * image (void)
QImage * image0 (void)
void init (const QString &s, const QString &image_file, const QColor &c, double pSize)
bool isMajorPlanet () const
virtual double labelOffset () const
virtual bool loadData ()
virtual double pa () const
dms phase ()
double physicalSize () const
double rearth () const
double rsun (void) const
void scaleRotateImage (float scale, double imageAngle)
void setAngularSize (double size)
void setColor (const QColor &c)
void setEcLat (double elat)
void setEcLat (dms elat)
void setEcLong (double elong)
void setEcLong (dms elong)
void setHelEcLat (double elat)
void setHelEcLat (dms elat)
void setHelEcLong (double elong)
void setHelEcLong (dms elong)
void setPA (double p)
void setPhysicalSize (double size)
void setRearth (const KSPlanetBase *Earth)
void setRearth (double r)
void setRsun (double r)
virtual void updateCoords (KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0)

Static Public Member Functions

static KSPlanetBase * createPlanet (int n)

Static Public Attributes

static QVector< QColor > planetColor

Protected Member Functions

virtual bool findGeocentricPosition (const KSNumbers *num, const KSPlanetBase *Earth=NULL)=0
virtual void findMagnitude (const KSNumbers *num)=0
void findPA (const KSNumbers *num)
virtual void findPhase ()
UID solarsysUID (UID type) const

Protected Attributes

EclipticPosition ep
EclipticPosition helEcPos
double Phase
double Rearth

Static Protected Attributes

static const UID UID_SOL_ASTEROID = 1
static const UID UID_SOL_BIGOBJ = 0
static const UID UID_SOL_COMET = 2

Detailed Description

A subclass of TrailObject that provides additional information needed for most solar system objects.

This is a base class for KSSun, KSMoon, KSPlanet, KSAsteroid, and KSComet. Those classes cover all solar system objects except planetary moons, which are derived directly from TrailObject Provides necessary information about objects in the solar system.

Author:
Mark Hollomon
Version:
1.0

Definition at line 64 of file ksplanetbase.h.


Member Enumeration Documentation

enum KSPlanetBase::Planets
Enumerator:
MERCURY 
VENUS 
MARS 
JUPITER 
SATURN 
URANUS 
NEPTUNE 
PLUTO 
SUN 
MOON 
UNKNOWN_PLANET 

Definition at line 83 of file ksplanetbase.h.


Constructor & Destructor Documentation

KSPlanetBase::KSPlanetBase ( const QString &  s = i18n("unnamed"),
const QString &  image_file = QString(),
const QColor &  c = Qt::white,
double  pSize = 0 
) [explicit]

Constructor.

Calls SkyObject constructor with type=2 (planet), coordinates=0.0, mag=0.0, primary name s, and all other QStrings empty.

Parameters:
s Name of planet
image_file filename of the planet's image
c color of the symbol to use for this planet
pSize the planet's physical size, in km

Definition at line 56 of file ksplanetbase.cpp.

virtual KSPlanetBase::~KSPlanetBase (  )  [inline, virtual]

Destructor (empty).

Definition at line 79 of file ksplanetbase.h.


Member Function Documentation

double KSPlanetBase::angSize (  )  const [inline]
Returns:
the Planet's angular size, in arcminutes

Definition at line 212 of file ksplanetbase.h.

QColor& KSPlanetBase::color (  )  [inline]
Returns:
the color for the planet symbol

Definition at line 231 of file ksplanetbase.h.

KSPlanetBase * KSPlanetBase::createPlanet ( int  n  )  [static]

Definition at line 82 of file ksplanetbase.cpp.

const dms* KSPlanetBase::ecLat ( void   )  const [inline]
Returns:
pointer to Ecliptic Latitude coordinate

Definition at line 98 of file ksplanetbase.h.

void KSPlanetBase::EclipticToEquatorial ( const dms *  Obliquity  ) 

Convert Ecliptic logitude/latitude to Right Ascension/Declination.

Parameters:
Obliquity current Obliquity of the Ecliptic (angle from Equator)

Definition at line 110 of file ksplanetbase.cpp.

const dms* KSPlanetBase::ecLong ( void   )  const [inline]
Returns:
pointer to Ecliptic Longitude coordinate

Definition at line 95 of file ksplanetbase.h.

void KSPlanetBase::EquatorialToEcliptic ( const dms *  Obliquity  ) 

Convert Right Ascension/Declination to Ecliptic logitude/latitude.

Parameters:
Obliquity current Obliquity of the Ecliptic (angle from Equator)

Definition at line 106 of file ksplanetbase.cpp.

virtual bool KSPlanetBase::findGeocentricPosition ( const KSNumbers *  num,
const KSPlanetBase *  Earth = NULL 
) [protected, pure virtual]

find the object's current geocentric equatorial coordinates (RA and Dec) This function is pure virtual; it must be overloaded by subclasses.

This function is private; it is called by the public function findPosition() which also includes the figure-of-the-earth correction, localizeCoords().

Parameters:
num pointer to current KSNumbers object
Earth pointer to planet Earth (needed to calculate geocentric coords)
Returns:
true if position was successfully calculated.
virtual void KSPlanetBase::findMagnitude ( const KSNumbers *  num  )  [protected, pure virtual]

Computes the visual magnitude for the major planets.

Parameters:
num pointer to a ksnumbers object. Needed for the saturn rings contribution to saturn's magnitude.
void KSPlanetBase::findPA ( const KSNumbers *  num  )  [protected]

Determine the position angle of the planet for a given date (used internally by findPosition() ).

Definition at line 249 of file ksplanetbase.cpp.

void KSPlanetBase::findPhase (  )  [protected, virtual]

Determine the phase of the planet.

Reimplemented in KSMoon.

Definition at line 295 of file ksplanetbase.cpp.

void KSPlanetBase::findPosition ( const KSNumbers *  num,
const dms *  lat = 0,
const dms *  LST = 0,
const KSPlanetBase *  Earth = 0 
)

Find position, including correction for Figure-of-the-Earth.

Parameters:
num KSNumbers pointer for the target date/time
lat pointer to the geographic latitude; if NULL, we skip localizeCoords()
LST pointer to the local sidereal time; if NULL, we skip localizeCoords()
Earth pointer to the Earth (not used for the Moon)

Definition at line 131 of file ksplanetbase.cpp.

const dms* KSPlanetBase::helEcLat ( void   )  const [inline]
Returns:
pointer to Ecliptic Heliocentric Latitude coordinate

Definition at line 126 of file ksplanetbase.h.

const dms* KSPlanetBase::helEcLong ( void   )  const [inline]
Returns:
pointer to Ecliptic Heliocentric Longitude coordinate

Definition at line 123 of file ksplanetbase.h.

QImage* KSPlanetBase::image ( void   )  [inline]
Returns:
pointer to image of planet

Definition at line 161 of file ksplanetbase.h.

QImage* KSPlanetBase::image0 ( void   )  [inline]
Returns:
pointer to unrotated image of planet

Definition at line 164 of file ksplanetbase.h.

void KSPlanetBase::init ( const QString &  s,
const QString &  image_file,
const QColor &  c,
double  pSize 
)

Definition at line 64 of file ksplanetbase.cpp.

bool KSPlanetBase::isMajorPlanet (  )  const
Returns:
true if the KSPlanet is one of the eight major planets

Definition at line 160 of file ksplanetbase.cpp.

double KSPlanetBase::labelOffset (  )  const [virtual]
Returns:
the pixel distance for offseting the object's name label

Reimplemented from SkyObject.

Definition at line 267 of file ksplanetbase.cpp.

virtual bool KSPlanetBase::loadData (  )  [inline, virtual]

Reimplemented in KSAsteroid, KSComet, KSMoon, KSPlanet, and KSSun.

Definition at line 89 of file ksplanetbase.h.

virtual double KSPlanetBase::pa (  )  const [inline, virtual]
Returns:
the Planet's position angle.

Reimplemented from SkyObject.

Definition at line 204 of file ksplanetbase.h.

dms KSPlanetBase::phase (  )  [inline]
Returns:
the phase angle of this planet

Definition at line 228 of file ksplanetbase.h.

double KSPlanetBase::physicalSize (  )  const [inline]
Returns:
the Planet's physical size, in km

Definition at line 220 of file ksplanetbase.h.

double KSPlanetBase::rearth (  )  const [inline]
Returns:
distance from Earth, in Astronomical Units (1 AU is Earth-Sun distance)

Definition at line 175 of file ksplanetbase.h.

double KSPlanetBase::rsun ( void   )  const [inline]
Returns:
distance from Sun, in Astronomical Units (1 AU is Earth-Sun distance)

Definition at line 167 of file ksplanetbase.h.

void KSPlanetBase::scaleRotateImage ( float  scale,
double  imageAngle 
)

scale and rotate Planet image

Parameters:
scale desired planet diameter in pixels
imageAngle angle in degrees to rotate image

Definition at line 287 of file ksplanetbase.cpp.

void KSPlanetBase::setAngularSize ( double  size  )  [inline]

set the planet's angular size, in km.

Parameters:
size the planet's size, in km

Definition at line 217 of file ksplanetbase.h.

void KSPlanetBase::setColor ( const QColor &  c  )  [inline]

Set the color for the planet symbol.

Definition at line 234 of file ksplanetbase.h.

void KSPlanetBase::setEcLat ( double  elat  )  [inline]

Set Ecliptic Geocentric Latitude according to argument.

Differs from above function only in argument type.

Parameters:
elat Ecliptic Latitude

Definition at line 120 of file ksplanetbase.h.

void KSPlanetBase::setEcLat ( dms  elat  )  [inline]

Set Ecliptic Geocentric Latitude according to argument.

Parameters:
elat Ecliptic Latitude

Definition at line 114 of file ksplanetbase.h.

void KSPlanetBase::setEcLong ( double  elong  )  [inline]

Set Ecliptic Geocentric Longitude according to argument.

Differs from above function only in argument type.

Parameters:
elong Ecliptic Longitude

Definition at line 109 of file ksplanetbase.h.

void KSPlanetBase::setEcLong ( dms  elong  )  [inline]

Set Ecliptic Geocentric Longitude according to argument.

Parameters:
elong Ecliptic Longitude

Definition at line 103 of file ksplanetbase.h.

void KSPlanetBase::setHelEcLat ( double  elat  )  [inline]

Set Ecliptic Heliocentric Latitude according to argument.

Differs from above function only in argument type.

Parameters:
elat Ecliptic Latitude

Definition at line 148 of file ksplanetbase.h.

void KSPlanetBase::setHelEcLat ( dms  elat  )  [inline]

Set Ecliptic Heliocentric Latitude according to argument.

Parameters:
elat Ecliptic Latitude

Definition at line 142 of file ksplanetbase.h.

void KSPlanetBase::setHelEcLong ( double  elong  )  [inline]

Set Ecliptic Heliocentric Longitude according to argument.

Differs from above function only in argument type.

Parameters:
elong Ecliptic Longitude

Definition at line 137 of file ksplanetbase.h.

void KSPlanetBase::setHelEcLong ( dms  elong  )  [inline]

Set Ecliptic Heliocentric Longitude according to argument.

Parameters:
elong Ecliptic Longitude

Definition at line 131 of file ksplanetbase.h.

void KSPlanetBase::setPA ( double  p  )  [inline]

Set the Planet's position angle.

Parameters:
p the new position angle

Definition at line 209 of file ksplanetbase.h.

void KSPlanetBase::setPhysicalSize ( double  size  )  [inline]

set the planet's physical size, in km.

Parameters:
size the planet's size, in km

Definition at line 225 of file ksplanetbase.h.

void KSPlanetBase::setRearth ( const KSPlanetBase *  Earth  ) 

compute and set the distance from Earth, in AU.

Parameters:
Earth pointer to the Earth from which to calculate the distance.

Definition at line 210 of file ksplanetbase.cpp.

void KSPlanetBase::setRearth ( double  r  )  [inline]

Set the distance from Earth, in AU.

Parameters:
r the new earth-distance in AU

Definition at line 180 of file ksplanetbase.h.

void KSPlanetBase::setRsun ( double  r  )  [inline]

Set the solar distance in AU.

Parameters:
r the new solar distance in AU

Definition at line 172 of file ksplanetbase.h.

UID KSPlanetBase::solarsysUID ( UID  type  )  const [inline, protected]

Compute high 32-bits of UID.

Definition at line 257 of file ksplanetbase.h.

void KSPlanetBase::updateCoords ( KSNumbers *  num,
bool  includePlanets = true,
const dms *  lat = 0,
const dms *  LST = 0 
) [virtual]

Update position of the planet (reimplemented from SkyPoint).

Parameters:
num current KSNumbers object
includePlanets this function does nothing if includePlanets=false
lat pointer to the geographic latitude; if NULL, we skip localizeCoords()
LST pointer to the local sidereal time; if NULL, we skip localizeCoords()

Reimplemented from SkyPoint.

Definition at line 114 of file ksplanetbase.cpp.


Member Data Documentation

EclipticPosition KSPlanetBase::ep [protected]

Definition at line 285 of file ksplanetbase.h.

EclipticPosition KSPlanetBase::helEcPos [protected]

Definition at line 289 of file ksplanetbase.h.

double KSPlanetBase::Phase [protected]

Definition at line 291 of file ksplanetbase.h.

QVector< QColor > KSPlanetBase::planetColor [static]
Initial value:
 QVector<QColor>() <<
  QColor("slateblue") << 
  QColor("lightgreen") << 
  QColor("red") << 
  QColor("goldenrod") << 
  QColor("khaki") << 
  QColor("lightseagreen") << 
  QColor("skyblue") << 
  QColor("grey") << 
  QColor("yellow") << 
  QColor("white")

Definition at line 87 of file ksplanetbase.h.

double KSPlanetBase::Rearth [protected]

Definition at line 290 of file ksplanetbase.h.

const SkyObject::UID KSPlanetBase::UID_SOL_ASTEROID = 1 [static, protected]

Asteroids.

Definition at line 252 of file ksplanetbase.h.

const SkyObject::UID KSPlanetBase::UID_SOL_BIGOBJ = 0 [static, protected]

Big object.

Planet, Moon, Sun.

Definition at line 250 of file ksplanetbase.h.

const SkyObject::UID KSPlanetBase::UID_SOL_COMET = 2 [static, protected]

Comets.

Definition at line 254 of file ksplanetbase.h.


The documentation for this class was generated from the following files:
  • ksplanetbase.h
  • ksplanetbase.cpp

kstars

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

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal