1 /* Copyright 2002-2025 CS GROUP
2 * Licensed to CS GROUP (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.forces.maneuvers.trigger;
18
19 import org.orekit.propagation.SpacecraftState;
20 import org.orekit.time.AbsoluteDate;
21
22 /** Resetter for maneuver triggers.
23 * @see AbstractManeuverTriggers
24 * @author Luc Maisonobe
25 * @since 11.1
26 */
27 public interface ManeuverTriggersResetter {
28
29 /** Initialization method called at propagation start.
30 * <p>
31 * The default implementation does nothing.
32 * </p>
33 * @param initialState initial spacecraft state (at the start of propagation).
34 * @param target date of propagation. Not equal to {@code initialState.getDate()}.
35 */
36 default void init(SpacecraftState initialState, AbsoluteDate target) {
37 // nothing by default
38 }
39
40 /** Observe a maneuver trigger.
41 * <p>
42 * The {@code start} parameter corresponds to physical flow of time
43 * from past to future, not to propagation direction which can be backward.
44 * This means that during forward propagations, the first call will have
45 * {@code start} set to {@code true} and the second call will have
46 * {@code start} set to {@code false}, whereas in backward propagation,
47 * the first call will have {@code start} set to {@code false} and the second
48 * call will have {@code start} set to {@code true}.
49 * </p>
50 * @param state spacecraft state at trigger date (before applying the maneuver)
51 * @param start if true, the trigger is the start of the maneuver
52 */
53 void maneuverTriggered(SpacecraftState state, boolean start);
54
55 /** Reset state as a maneuver triggers.
56 * @param state spacecraft state at trigger date
57 * @return reset state taking into account maneuver start/stop
58 */
59 SpacecraftState resetState(SpacecraftState state);
60
61 }