CenterName.java

  1. /* Copyright 2002-2013 CS Systèmes d'Information
  2.  * Licensed to CS Systèmes d'Information (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.files.ccsds;

  18. import org.orekit.bodies.CelestialBody;
  19. import org.orekit.bodies.CelestialBodyFactory;
  20. import org.orekit.errors.OrekitException;

  21. /** Orbit central bodies for which a Celestial body can be created.
  22.  * @author sports
  23.  * @since 6.1
  24.  */
  25. public enum CenterName {
  26.     /** Solar system barycenter aggregated body. */
  27.     SOLAR_SYSTEM_BARYCENTER {

  28.         /** {@inheritDoc} */
  29.         public CelestialBody getCelestialBody()
  30.             throws OrekitException {
  31.             return CelestialBodyFactory.getSolarSystemBarycenter();
  32.         }
  33.     },
  34.     /** Sun body. */
  35.     SUN {

  36.         /** {@inheritDoc} */
  37.         public CelestialBody getCelestialBody()
  38.             throws OrekitException {
  39.             return CelestialBodyFactory.getSun();
  40.         }
  41.     },
  42.     /** Mercury body. */
  43.     MERCURY {

  44.         /** {@inheritDoc} */
  45.         public CelestialBody getCelestialBody()
  46.             throws OrekitException {
  47.             return CelestialBodyFactory.getMercury();
  48.         }
  49.     },
  50.     /** Venus body. */
  51.     VENUS {

  52.         /** {@inheritDoc} */
  53.         public CelestialBody getCelestialBody()
  54.             throws OrekitException {
  55.             return CelestialBodyFactory.getVenus();
  56.         }
  57.     },
  58.     /** Earth-Moon barycenter bodies pair. */
  59.     EARTH_MOON {

  60.         /** {@inheritDoc} */
  61.         public CelestialBody getCelestialBody()
  62.             throws OrekitException {
  63.             return CelestialBodyFactory.getEarthMoonBarycenter();
  64.         }
  65.     },
  66.     /** Earth body. */
  67.     EARTH {

  68.         /** {@inheritDoc} */
  69.         public CelestialBody getCelestialBody()
  70.             throws OrekitException {
  71.             return CelestialBodyFactory.getEarth();
  72.         }
  73.     },
  74.     /** Moon body. */
  75.     MOON {

  76.         /** {@inheritDoc} */
  77.         public CelestialBody getCelestialBody()
  78.             throws OrekitException {
  79.             return CelestialBodyFactory.getMoon();
  80.         }
  81.     },
  82.     /** Mars body. */
  83.     MARS {

  84.         /** {@inheritDoc} */
  85.         public CelestialBody getCelestialBody()
  86.             throws OrekitException {
  87.             return CelestialBodyFactory.getMars();
  88.         }
  89.     },
  90.     /** Jupiter body. */
  91.     JUPITER {

  92.         /** {@inheritDoc} */
  93.         public CelestialBody getCelestialBody()
  94.             throws OrekitException {
  95.             return CelestialBodyFactory.getJupiter();
  96.         }
  97.     },
  98.     /** Saturn body. */
  99.     SATURN {

  100.         /** {@inheritDoc} */
  101.         public CelestialBody getCelestialBody()
  102.             throws OrekitException {
  103.             return CelestialBodyFactory.getSaturn();
  104.         }
  105.     },
  106.     /** Uranus body. */
  107.     URANUS {

  108.         /** {@inheritDoc} */
  109.         public CelestialBody getCelestialBody()
  110.             throws OrekitException {
  111.             return CelestialBodyFactory.getUranus();
  112.         }
  113.     },
  114.     /** Neptune body. */
  115.     NEPTUNE {

  116.         /** {@inheritDoc} */
  117.         public CelestialBody getCelestialBody()
  118.             throws OrekitException {
  119.             return CelestialBodyFactory.getNeptune();
  120.         }
  121.     },
  122.     /** Pluto body. */
  123.     PLUTO {

  124.         /** {@inheritDoc} */
  125.         public CelestialBody getCelestialBody()
  126.             throws OrekitException {
  127.             return CelestialBodyFactory.getPluto();
  128.         }
  129.     };

  130.     /**
  131.      * Get the celestial body corresponding to the CCSDS constant.
  132.      * @return celestial body corresponding to the CCSDS constant
  133.      * @exception OrekitException if the Celestial body cannot be retrieved
  134.      */
  135.     public abstract CelestialBody getCelestialBody()
  136.         throws OrekitException;

  137. }