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.propagation.sampling;
18
19 import org.orekit.errors.OrekitException;
20 import org.orekit.errors.PropagationException;
21 import org.orekit.propagation.SpacecraftState;
22 import org.orekit.time.AbsoluteDate;
23
24 /** This interface is a space-dynamics aware step interpolator.
25 *
26 * <p>It mirrors the <code>StepInterpolator</code> interface from <a
27 * href="http://commons.apache.org/math/"> commons-math</a> but
28 * provides a space-dynamics interface to the methods.</p>
29 * @author Luc Maisonobe
30 */
31 public interface OrekitStepInterpolator {
32
33 /** Get the current grid date.
34 * @return current grid date
35 */
36 AbsoluteDate getCurrentDate();
37
38 /** Get the previous grid date.
39 * @return previous grid date
40 */
41 AbsoluteDate getPreviousDate();
42
43 /** Get the interpolated date.
44 * <p>If {@link #setInterpolatedDate(AbsoluteDate) setInterpolatedDate}
45 * has not been called, the date returned is the same as {@link
46 * #getCurrentDate() getCurrentDate}.</p>
47 * @return interpolated date
48 * @see #setInterpolatedDate(AbsoluteDate)
49 * @see #getInterpolatedState()
50 */
51 AbsoluteDate getInterpolatedDate();
52
53 /** Set the interpolated date.
54 * <p>It is possible to set the interpolation date outside of the current
55 * step range, but accuracy will decrease as date is farther.</p>
56 * @param date interpolated date to set
57 * @exception PropagationException if underlying interpolator cannot handle
58 * the date
59 * @see #getInterpolatedDate()
60 * @see #getInterpolatedState()
61 */
62 void setInterpolatedDate(final AbsoluteDate date)
63 throws PropagationException;
64
65 /** Get the interpolated state.
66 * @return interpolated state at the current interpolation date
67 * @exception OrekitException if state cannot be interpolated or converted
68 * @see #getInterpolatedDate()
69 * @see #setInterpolatedDate(AbsoluteDate)
70 */
71 SpacecraftState getInterpolatedState() throws OrekitException;
72
73 /** Check is integration direction is forward in date.
74 * @return true if integration is forward in date
75 */
76 boolean isForward();
77
78 }