I. Planet
A. Earth
1. Earth-based observa-
tories
2. Earth
orbiters
B. Planetary
landers
C. Planetary
orbiters
II. Deep space probes (i.e., gravi-
tationally unbound from all
planets and satellites)
Figure 11 shows the object
hierarchy of observing plat-
forms.
17
The C++ code
classes reflect this hierarchy.
Each input data stream will
contain relevant observing
platform information. An
appropriate observing plat-
form object will encapsulate this information. Each type of platform ob-
ject also encapsulates the necessary functionality (referred to as methods)
to provide information needed to manipulate or transform data of the cor-
responding type (see Figures 5 and 11).
For example, planetary observing platform objects know how to precess
and nutate coordinates to a specified epoch. Each base class contains pa-
rameters and functionality common to all subclasses derived from it. The
derived classes contain only the additional or specialized parameters and
functionality required to handle platforms of a specific kind. For example,
since all planetary platforms have a basic precession and nutation capabil-
ity, these methods reside in the base class
PlanetPlatform
. An
EarthPlatform
object automatically inherits all the functionality and data of
PlanetPlatform
.
The
EarthPlatform
object therefore contains only additional abilities, data, or
refinements, for example precession parameters specific to the Earth.
Proper use of inheritance eliminates code duplication for common tasks in
a natural and intuitive way. The inheritance mechanism is built into the
C++ language and therefore requires no enforcement by or special disci-
pline from the programmer.
MURISON: MODELING PLANETARY MOTIONS
17 of 20
17
Arrows in Figures 11 and 12 point from derived classes to parent (also called base)
classes. This is the standard notation.
Figure 11 -- Observing platform class hierarchy.
Platform
PlanetPlatform
SpacecraftPlatform
EarthPlatform
OrbiterPlatform
ProbePlatform
EarthOrbiterPlatform
epoch
central object
local position
local coord origin
precess
nutate
class method
encapsulated data
multiple inheritance