1   /* Copyright 2002-2019 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.propagation.SpacecraftState;
20  import org.orekit.time.AbsoluteDate;
21  
22  /** This interface is a space-dynamics aware step interpolator.
23   *
24   * <p>It mirrors the <code>ODEStateInterpolator</code> interface from <a
25   * href="https://hipparchus.org/">Hipparchus</a> but
26   * provides a space-dynamics interface to the methods.</p>
27   * @author Luc Maisonobe
28   */
29  public interface OrekitStepInterpolator {
30  
31      /**
32       * Get the state at previous grid point date.
33       * @return state at previous grid point date
34       */
35      SpacecraftState getPreviousState();
36  
37      /**
38       * Determines if the {@link #getPreviousState() previous state} is computed directly
39       * by the integrator, or if it is calculated using {@link #getInterpolatedState(AbsoluteDate)
40       * interpolation}.
41       *
42       * <p> Typically the previous state is directly computed by the integrator, but when
43       * events are detected the steps are shortened so that events occur on step boundaries
44       * which means the previous state may be computed by the interpolator.
45       *
46       * @return {@code true} if the previous state was calculated by the interpolator and
47       * false if it was computed directly by the integrator.
48       */
49      boolean isPreviousStateInterpolated();
50  
51      /**
52       * Get the state at current grid point date.
53       * @return state at current grid point date
54       */
55      SpacecraftState getCurrentState();
56  
57      /**
58       * Determines if the {@link #getCurrentState() current state} is computed directly by
59       * the integrator, or if it is calculated using {@link #getInterpolatedState(AbsoluteDate)
60       * interpolation}.
61       *
62       * <p> Typically the current state is directly computed by the integrator, but when
63       * events are detected the steps are shortened so that events occur on step boundaries
64       * which means the current state may be computed by the interpolator.
65       *
66       * @return {@code true} if the current state was calculated by the interpolator and
67       * false if it was computed directly by the integrator.
68       */
69      boolean isCurrentStateInterpolated();
70  
71      /** Get the state at interpolated date.
72       * @param date date of the interpolated state
73       * @return state at interpolated date
74       */
75      SpacecraftState getInterpolatedState(AbsoluteDate date);
76  
77      /** Check is integration direction is forward in date.
78       * @return true if integration is forward in date
79       */
80      boolean isForward();
81  
82      /** Create a new restricted version of the instance.
83       * <p>
84       * The instance is not changed at all.
85       * </p>
86       * @param newPreviousState start of the restricted step
87       * @param newCurrentState end of the restricted step
88       * @return restricted version of the instance
89            * @see #getPreviousState()
90       * @see #getCurrentState()
91       * @since 9.0
92       */
93      OrekitStepInterpolator restrictStep(SpacecraftStaterekit/propagation/SpacecraftState.html#SpacecraftState">SpacecraftState newPreviousState, SpacecraftState newCurrentState);
94  
95  }