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
18 package org.orekit.frames;
19
20 import org.hipparchus.CalculusFieldElement;
21 import org.orekit.time.AbsoluteDate;
22 import org.orekit.time.FieldAbsoluteDate;
23
24 /** Interface for Transform providers.
25 * <p>The transform provider interface is mainly used to define the
26 * transform between a frame and its parent frame.
27 * </p>
28 * @author Luc Maisonobe
29 */
30 public interface TransformProvider {
31
32 /** Get the {@link Transform} corresponding to specified date.
33 * @param date current date
34 * @return transform at specified date
35 */
36 Transform getTransform(AbsoluteDate date);
37
38 /** Get the {@link FieldTransform} corresponding to specified date.
39 * @param date current date
40 * @param <T> type of the field elements
41 * @return transform at specified date
42 * @since 9.0
43 */
44 <T extends CalculusFieldElement<T>> FieldTransform<T> getTransform(FieldAbsoluteDate<T> date);
45
46 /**
47 * Get a transform for position and velocity, not acceleration.
48 *
49 * <p>The default implementation returns {@link #getTransform(AbsoluteDate)}
50 * but implementations may override it for better performance.
51 *
52 * @param date current date.
53 * @return the kinematic transform.
54 * @since 12.1
55 */
56 default KinematicTransform getKinematicTransform(AbsoluteDate date) {
57 return getTransform(date);
58 }
59
60 /**
61 * Get a transform for position and velocity, not acceleration.
62 *
63 * <p>The default implementation returns {@link #getTransform(AbsoluteDate)}
64 * but implementations may override it for better performance.
65 *
66 * @param <T> type of the elements
67 * @param date current date.
68 * @return the kinematic transform.
69 * @since 12.1
70 */
71 default <T extends CalculusFieldElement<T>> FieldKinematicTransform<T> getKinematicTransform(FieldAbsoluteDate<T> date) {
72 return getTransform(date);
73 }
74
75 /**
76 * Get a transform for only rotations and translations on the specified date.
77 *
78 * <p>The default implementation calls {@link #getTransform(AbsoluteDate)}
79 * but implementations may override it for better performance.
80 *
81 * @param date current date.
82 * @return the static transform.
83 */
84 default StaticTransform getStaticTransform(AbsoluteDate date) {
85 return getTransform(date).toStaticTransform();
86 }
87
88 /**
89 * Get a transform for only rotations and translations on the specified date.
90 *
91 * <p>The default implementation returns {@link #getTransform(AbsoluteDate)}
92 * but implementations may override it for better performance.
93 *
94 * @param <T> type of the elements
95 * @param date current date.
96 * @return the static transform.
97 * @since 12.0
98 */
99 default <T extends CalculusFieldElement<T>> FieldStaticTransform<T> getStaticTransform(FieldAbsoluteDate<T> date) {
100 return getTransform(date).toStaticTransform();
101 }
102
103 }