org.stellarium.astro
Class Planet

java.lang.Object
  extended by org.stellarium.StelObject
      extended by org.stellarium.StelObjectBase
          extended by org.stellarium.astro.Planet

public class Planet
extends StelObjectBase

A planet.

Version:
0.8.2
Author:
Jerome Beau, Fred Simon

Nested Class Summary
static class Planet.Ring
          Class to manage rings for planets like saturn
(package private)  class Planet.RotationElements
          Class used to store orbital elements
(package private)  class Planet.TrailPoint
           
 
Nested classes/interfaces inherited from class org.stellarium.StelObject
StelObject.TYPE
 
Field Summary
(package private)  double albedo
           
(package private)  double axisRotation
           
(package private)  double bigHaloSize
           
(package private)  SColor color
           
(package private)  PosFunc coordFunc
           
(package private)  double deltaJD
           
(package private)  double deltaOrbitJD
           
(package private)  double deltaTrail
           
(package private)  double distance
          Temporary variable used to store the distance to a given point it is used for sorting while drawing
(package private)  javax.vecmath.Point3d eclipticPos
          Position in UA in the rectangular ecliptic coordinate system centered on the parent planet
(package private)  java.lang.String englishName
           
(package private)  boolean firstPoint
           
(package private)  boolean flagHalo
           
(package private)  boolean flagLighting
           
(package private) static LinearFader flagShow
           
(package private)  boolean hidden
           
(package private)  LinearFader hintFader
           
static double J2000
           
(package private) static SColor labelColor
           
(package private)  double lastJD
           
(package private)  double lastOrbitJD
           
(package private)  double lastTrailJD
           
(package private)  javax.vecmath.Matrix4d matLocalToParent
           
(package private)  int maxTrail
           
(package private)  java.lang.String nameI18n
           
(package private) static double object_scale
           
(package private)  double one_minus_oblateness
           
(package private)  javax.vecmath.Point3d[] orbit
           
static int ORBIT_SEGMENTS
           
(package private)  boolean orbitCached
           
(package private) static SColor orbitColor
           
(package private)  LinearFader orbitFader
           
(package private)  OsulatingFunc osculating_func
           
(package private)  Planet parent
           
(package private) static SFontIfc planetNameFontIfc
           
(package private)  javax.vecmath.Point3d previousScreenPos
           
(package private)  double radius
           
(package private)  Planet.RotationElements re
           
(package private)  Planet.Ring rings
           
(package private)  javax.vecmath.Matrix4d rotLocalToParent
           
(package private)  java.util.List<Planet> satellites
          satellites of the planet
(package private)  javax.vecmath.Point3d screenPos
           
(package private)  float sphereScale
           
(package private)  STexture texBigHalo
           
(package private)  STexture texHalo
           
(package private)  STexture texMap
           
(package private)  java.util.LinkedList<Planet.TrailPoint> trail
           
(package private) static SColor trailColor
           
(package private)  LinearFader trailFader
           
(package private)  boolean trailOn
           
 
Fields inherited from class org.stellarium.StelObjectBase
DEFAULT_COLOR
 
Constructor Summary
Planet(Planet parent, java.lang.String _englishName, boolean _flagHalo, boolean _flagLighting, double _radius, double oblateness, SColor someColor, double _albedo, java.lang.String texMapName, java.lang.String texHaloName, PosFunc someCoordFunc, OsulatingFunc osulatingFunc, boolean hidden)
           
 
Method Summary
(package private)  double computeDistance(javax.vecmath.Point3d obsHelioPos)
           
(package private)  float computeMagnitude(NavigatorIfc nav)
           
(package private)  float computeMagnitude(javax.vecmath.Point3d obsPos)
           
(package private)  void computePosition(double date)
          Compute the position in the parent planet coordinate system Actually call the provided function to compute the ecliptical position
(package private)  void computePositionWithoutOrbits(double date)
           
(package private)  void computeTransMatrix(double jd)
          Compute the transformation matrix from the local planet coordinate to the parent planet coordinate
(package private)  double draw(DefaultProjector prj, NavigatorIfc nav, ToneReproductor eye, boolean flagPoint, boolean stencil)
          Draw the planet and all the related infos : name, circle etc..
protected  void drawBigHalo(NavigatorIfc nav, DefaultProjector prj, ToneReproductor eye)
           
protected  void drawHalo(NavigatorIfc nav, DefaultProjector prj, ToneReproductor eye)
          Draw the small star-like 2D halo
(package private)  void drawHints(NavigatorIfc nav, DefaultProjector prj)
          Draw the circle and name of the planet
 void drawOrbit(NavigatorIfc nav, DefaultProjector prj)
          draw orbital path of planet
protected  void drawPointHalo(NavigatorIfc nav, DefaultProjector prj, ToneReproductor eye)
          Draw the small star-like point
(package private)  void drawSphere(DefaultProjector prj, javax.vecmath.Matrix4d mat, double screenSz)
           
(package private)  void drawTrail(NavigatorIfc nav, DefaultProjector prj)
          draw trail of planet as seen from earth
 double getCloseFOV(NavigatorIfc nav)
          Tree.Return the best FOV in degree to use for a close view of the object
 double getDistance()
           
 javax.vecmath.Point3d getEarthEquPos(NavigatorIfc nav)
          Return the planet position in rectangular earth equatorial coordinate
 javax.vecmath.Point3d getEclipticPos()
           
 java.lang.String getEnglishName()
          Return object's name
(package private)  boolean getFlagHints()
           
(package private)  boolean getFlagOrbits()
           
(package private) static boolean getflagShow()
           
(package private)  boolean getFlagTrail()
           
 javax.vecmath.Point3d getHeliocentricEclipticPos()
          used only for earth shadow, lunar eclipse
 java.lang.String getInfoString(NavigatorIfc nav)
          Write I18n information about the object in wstring.
static SColor getLabelColor()
           
private  double getLengthEarthEquPos(NavigatorIfc nav)
           
 float getMag(NavigatorIfc nav)
           
 STexture getMapTexture()
           
 java.lang.String getNameI18n()
           
 javax.vecmath.Point3d getObsJ2000Pos(NavigatorIfc nav)
          observer centered J2000 coordinates TODO: Fred Should be abstract method no?
protected  float getOnScreenSize(Projector prj, NavigatorIfc nav)
          Return the radius of a circle containing the object on screen
static SColor getOrbitColor()
           
(package private)  Planet getParent()
           
 double getParentSatellitesFOV(NavigatorIfc nav)
           
 double getPhase(javax.vecmath.Point3d obsPos)
           
 double getRadius()
           
 double getRotAscendingnode()
           
 javax.vecmath.Matrix4d getRotEquatorialToVsop87()
           
 double getRotObliquity()
           
 double getSatellitesFOV(NavigatorIfc nav)
           
(package private) static double getScale()
           
 java.lang.String getShortInfoString(NavigatorIfc nav)
          The returned wstring can typically be used for object labeling in the sky
 double getSiderealTime(double jd)
          Compute the z rotation to use from equatorial to geographic coordinates
(package private)  java.lang.String getSkyLabel(NavigatorIfc nav)
          Get sky label (sky translation)
 float getSphereScale()
           
static SColor getTrailColor()
           
 StelObject.TYPE getType()
          Tree.Return object's type
(package private)  void setBigHalo(java.lang.String halotexfile)
           
(package private)  void setFlagHints(boolean b)
           
(package private)  void setFlagOrbits(boolean b)
           
(package private) static void setflagShow(boolean b)
           
 void setFlagTrail(boolean b)
           
(package private) static void setFont(SFontIfc f)
           
(package private)  void setHaloSize(double s)
           
(package private) static void setLabelColor(SColor lc)
           
(package private)  void setNameI18n(java.lang.String cn)
           
(package private) static void setOrbitColor(SColor oc)
           
(package private)  void setRings(Planet.Ring r)
           
(package private)  void setRotationElements(double _period, double _offset, double _epoch, double _obliquity, double _ascendingNode, double _precessionRate, double _sideralPeriod)
          Set the orbital elements
(package private) static void setScale(double s)
           
 void setSphereScale(float s)
           
(package private) static void setTrailColor(SColor _color)
           
(package private)  void startTrail(boolean b)
          start/stop accumulating new trail data (clear old data)
 void translateName(Translator trans)
           
(package private)  void update(int delta_time)
           
(package private)  void updateTrail(NavigatorIfc nav)
          update trail points as needed
 
Methods inherited from class org.stellarium.StelObjectBase
deleteTextures, drawPointer, getBrightestStarInConstellation, getMag, getRGB, initTextures, release, retain, update
 
Methods inherited from class org.stellarium.StelObject
getUninitializedObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

J2000

public static final double J2000
See Also:
Constant Field Values

ORBIT_SEGMENTS

public static final int ORBIT_SEGMENTS
See Also:
Constant Field Values

englishName

java.lang.String englishName

nameI18n

java.lang.String nameI18n

flagHalo

boolean flagHalo

flagLighting

boolean flagLighting

re

Planet.RotationElements re

radius

double radius

one_minus_oblateness

double one_minus_oblateness

orbit

javax.vecmath.Point3d[] orbit

eclipticPos

javax.vecmath.Point3d eclipticPos
Position in UA in the rectangular ecliptic coordinate system centered on the parent planet


screenPos

javax.vecmath.Point3d screenPos

previousScreenPos

javax.vecmath.Point3d previousScreenPos

color

SColor color

albedo

double albedo

rotLocalToParent

javax.vecmath.Matrix4d rotLocalToParent

matLocalToParent

javax.vecmath.Matrix4d matLocalToParent

axisRotation

double axisRotation

texMap

STexture texMap

texHalo

STexture texHalo

texBigHalo

STexture texBigHalo

bigHaloSize

double bigHaloSize

rings

Planet.Ring rings

distance

double distance
Temporary variable used to store the distance to a given point it is used for sorting while drawing


sphereScale

float sphereScale

lastJD

double lastJD

lastOrbitJD

double lastOrbitJD

deltaJD

double deltaJD

deltaOrbitJD

double deltaOrbitJD

orbitCached

boolean orbitCached

coordFunc

PosFunc coordFunc

osculating_func

OsulatingFunc osculating_func

parent

Planet parent

satellites

java.util.List<Planet> satellites
satellites of the planet


planetNameFontIfc

static SFontIfc planetNameFontIfc

object_scale

static double object_scale

labelColor

static SColor labelColor

orbitColor

static SColor orbitColor

trailColor

static SColor trailColor

trail

java.util.LinkedList<Planet.TrailPoint> trail

trailOn

boolean trailOn

deltaTrail

double deltaTrail

maxTrail

int maxTrail

lastTrailJD

double lastTrailJD

firstPoint

boolean firstPoint

flagShow

static final LinearFader flagShow

hintFader

LinearFader hintFader

orbitFader

LinearFader orbitFader

trailFader

LinearFader trailFader

hidden

boolean hidden
Constructor Detail

Planet

Planet(Planet parent,
       java.lang.String _englishName,
       boolean _flagHalo,
       boolean _flagLighting,
       double _radius,
       double oblateness,
       SColor someColor,
       double _albedo,
       java.lang.String texMapName,
       java.lang.String texHaloName,
       PosFunc someCoordFunc,
       OsulatingFunc osulatingFunc,
       boolean hidden)
 throws StellariumException
Throws:
StellariumException
Method Detail

getInfoString

public java.lang.String getInfoString(NavigatorIfc nav)
Description copied from class: StelObject
Write I18n information about the object in wstring.

Specified by:
getInfoString in class StelObject
Parameters:
nav -
Returns:
the information String "ready to print" :)

getSkyLabel

java.lang.String getSkyLabel(NavigatorIfc nav)
Get sky label (sky translation)

Parameters:
nav -
Returns:

getShortInfoString

public java.lang.String getShortInfoString(NavigatorIfc nav)
Description copied from class: StelObject
The returned wstring can typically be used for object labeling in the sky

Specified by:
getShortInfoString in class StelObject
Returns:
The information String "ready to print" :)

getCloseFOV

public double getCloseFOV(NavigatorIfc nav)
Description copied from class: StelObjectBase
Tree.Return the best FOV in degree to use for a close view of the object

Overrides:
getCloseFOV in class StelObjectBase

getLengthEarthEquPos

private double getLengthEarthEquPos(NavigatorIfc nav)

getSatellitesFOV

public double getSatellitesFOV(NavigatorIfc nav)
Overrides:
getSatellitesFOV in class StelObjectBase

getParentSatellitesFOV

public double getParentSatellitesFOV(NavigatorIfc nav)
Overrides:
getParentSatellitesFOV in class StelObjectBase

setRotationElements

void setRotationElements(double _period,
                         double _offset,
                         double _epoch,
                         double _obliquity,
                         double _ascendingNode,
                         double _precessionRate,
                         double _sideralPeriod)
Set the orbital elements

Parameters:
_period -
_offset -
_epoch -
_obliquity -
_ascendingNode -
_precessionRate -
_sideralPeriod -

getRotAscendingnode

public double getRotAscendingnode()

getRotObliquity

public double getRotObliquity()

getEarthEquPos

public javax.vecmath.Point3d getEarthEquPos(NavigatorIfc nav)
Return the planet position in rectangular earth equatorial coordinate

Overrides:
getEarthEquPos in class StelObjectBase

getObsJ2000Pos

public javax.vecmath.Point3d getObsJ2000Pos(NavigatorIfc nav)
Description copied from class: StelObjectBase
observer centered J2000 coordinates TODO: Fred Should be abstract method no?

Overrides:
getObsJ2000Pos in class StelObjectBase

computePositionWithoutOrbits

void computePositionWithoutOrbits(double date)

computePosition

void computePosition(double date)
Compute the position in the parent planet coordinate system Actually call the provided function to compute the ecliptical position

Parameters:
date -

computeTransMatrix

void computeTransMatrix(double jd)
Compute the transformation matrix from the local planet coordinate to the parent planet coordinate

Parameters:
jd -

getRotEquatorialToVsop87

public javax.vecmath.Matrix4d getRotEquatorialToVsop87()

getSiderealTime

public double getSiderealTime(double jd)
Compute the z rotation to use from equatorial to geographic coordinates

Parameters:
jd -

getEclipticPos

public javax.vecmath.Point3d getEclipticPos()
Returns:
The planet position in the parent planet ecliptic coordinate

getHeliocentricEclipticPos

public javax.vecmath.Point3d getHeliocentricEclipticPos()
used only for earth shadow, lunar eclipse

Returns:
The heliocentric ecliptical position

computeDistance

double computeDistance(javax.vecmath.Point3d obsHelioPos)
Parameters:
obsHelioPos -
Returns:
the distance to the given position in heliocentric coordinate (in AU)

getPhase

public double getPhase(javax.vecmath.Point3d obsPos)
Parameters:
obsPos -
Returns:
the phase angle for an observer at pos obsPos in the heliocentric coordinate (dist in AU)

computeMagnitude

float computeMagnitude(javax.vecmath.Point3d obsPos)

computeMagnitude

float computeMagnitude(NavigatorIfc nav)

setBigHalo

void setBigHalo(java.lang.String halotexfile)
          throws StellariumException
Throws:
StellariumException

getOnScreenSize

protected float getOnScreenSize(Projector prj,
                                NavigatorIfc nav)
Return the radius of a circle containing the object on screen

Overrides:
getOnScreenSize in class StelObjectBase

draw

double draw(DefaultProjector prj,
            NavigatorIfc nav,
            ToneReproductor eye,
            boolean flagPoint,
            boolean stencil)
Draw the planet and all the related infos : name, circle etc..

Parameters:
prj -
nav -
eye -
flagPoint -

drawHints

void drawHints(NavigatorIfc nav,
               DefaultProjector prj)
Draw the circle and name of the planet

Parameters:
nav -
prj -

drawSphere

void drawSphere(DefaultProjector prj,
                javax.vecmath.Matrix4d mat,
                double screenSz)

drawHalo

protected void drawHalo(NavigatorIfc nav,
                        DefaultProjector prj,
                        ToneReproductor eye)
Draw the small star-like 2D halo

Parameters:
nav -
prj -
eye -

drawPointHalo

protected void drawPointHalo(NavigatorIfc nav,
                             DefaultProjector prj,
                             ToneReproductor eye)
Draw the small star-like point

Parameters:
nav -
prj -
eye -

drawBigHalo

protected void drawBigHalo(NavigatorIfc nav,
                           DefaultProjector prj,
                           ToneReproductor eye)

drawOrbit

public void drawOrbit(NavigatorIfc nav,
                      DefaultProjector prj)
draw orbital path of planet

Parameters:
nav -
prj -

drawTrail

void drawTrail(NavigatorIfc nav,
               DefaultProjector prj)
draw trail of planet as seen from earth

Parameters:
nav -
prj -

updateTrail

void updateTrail(NavigatorIfc nav)
update trail points as needed

Parameters:
nav -

startTrail

void startTrail(boolean b)
start/stop accumulating new trail data (clear old data)


update

void update(int delta_time)

setFlagHints

void setFlagHints(boolean b)

getFlagHints

boolean getFlagHints()

setFlagOrbits

void setFlagOrbits(boolean b)

getFlagOrbits

boolean getFlagOrbits()

setFlagTrail

public void setFlagTrail(boolean b)

getFlagTrail

boolean getFlagTrail()

setflagShow

static void setflagShow(boolean b)

getflagShow

static boolean getflagShow()

translateName

public void translateName(Translator trans)

getMag

public float getMag(NavigatorIfc nav)
Overrides:
getMag in class StelObjectBase
Returns:
object's magnitude

getDistance

public double getDistance()

getType

public StelObject.TYPE getType()
Description copied from class: StelObjectBase
Tree.Return object's type

Specified by:
getType in class StelObjectBase

getEnglishName

public java.lang.String getEnglishName()
Description copied from class: StelObjectBase
Return object's name

Overrides:
getEnglishName in class StelObjectBase

getNameI18n

public java.lang.String getNameI18n()
Overrides:
getNameI18n in class StelObjectBase

setNameI18n

void setNameI18n(java.lang.String cn)

setRings

void setRings(Planet.Ring r)

setSphereScale

public void setSphereScale(float s)

getSphereScale

public float getSphereScale()

getParent

Planet getParent()

setHaloSize

void setHaloSize(double s)

setFont

static void setFont(SFontIfc f)

setScale

static void setScale(double s)

getScale

static double getScale()

setLabelColor

static void setLabelColor(SColor lc)

getLabelColor

public static SColor getLabelColor()

setOrbitColor

static void setOrbitColor(SColor oc)

getOrbitColor

public static SColor getOrbitColor()

getTrailColor

public static SColor getTrailColor()

setTrailColor

static void setTrailColor(SColor _color)

getRadius

public double getRadius()

getMapTexture

public STexture getMapTexture()