TransformProvider.java

  1. /* Copyright 2002-2024 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.frames;

  18. import java.io.Serializable;

  19. import org.hipparchus.CalculusFieldElement;
  20. import org.orekit.time.AbsoluteDate;
  21. import org.orekit.time.FieldAbsoluteDate;

  22. /** Interface for Transform providers.
  23.  * <p>The transform provider interface is mainly used to define the
  24.  * transform between a frame and its parent frame.
  25.  * </p>
  26.  * @author Luc Maisonobe
  27.  */
  28. public interface TransformProvider extends Serializable {

  29.     /** Get the {@link Transform} corresponding to specified date.
  30.      * @param date current date
  31.      * @return transform at specified date
  32.      */
  33.     Transform getTransform(AbsoluteDate date);

  34.     /** Get the {@link FieldTransform} corresponding to specified date.
  35.      * @param date current date
  36.      * @param <T> type of the field elements
  37.      * @return transform at specified date
  38.      * @since 9.0
  39.      */
  40.     <T extends CalculusFieldElement<T>> FieldTransform<T> getTransform(FieldAbsoluteDate<T> date);

  41.     /**
  42.      * Get a transform for position and velocity, not acceleration.
  43.      *
  44.      * <p>The default implementation returns {@link #getTransform(AbsoluteDate)}
  45.      * but implementations may override it for better performance.
  46.      *
  47.      * @param date current date.
  48.      * @return the kinematic transform.
  49.      * @since 12.1
  50.      */
  51.     default KinematicTransform getKinematicTransform(AbsoluteDate date) {
  52.         return getTransform(date);
  53.     }

  54.     /**
  55.      * Get a transform for position and velocity, not acceleration.
  56.      *
  57.      * <p>The default implementation returns {@link #getTransform(AbsoluteDate)}
  58.      * but implementations may override it for better performance.
  59.      *
  60.      * @param <T> type of the elements
  61.      * @param date current date.
  62.      * @return the kinematic transform.
  63.      * @since 12.1
  64.      */
  65.     default <T extends CalculusFieldElement<T>> FieldKinematicTransform<T> getKinematicTransform(FieldAbsoluteDate<T> date) {
  66.         return getTransform(date);
  67.     }

  68.     /**
  69.      * Get a transform for only rotations and translations on the specified date.
  70.      *
  71.      * <p>The default implementation calls {@link #getTransform(AbsoluteDate)}
  72.      * but implementations may override it for better performance.
  73.      *
  74.      * @param date current date.
  75.      * @return the static transform.
  76.      */
  77.     default StaticTransform getStaticTransform(AbsoluteDate date) {
  78.         return getTransform(date).toStaticTransform();
  79.     }

  80.     /**
  81.      * Get a transform for only rotations and translations on the specified date.
  82.      *
  83.      * <p>The default implementation returns {@link #getTransform(AbsoluteDate)}
  84.      * but implementations may override it for better performance.
  85.      *
  86.      * @param <T> type of the elements
  87.      * @param date current date.
  88.      * @return the static transform.
  89.      * @since 12.0
  90.      */
  91.     default <T extends CalculusFieldElement<T>> FieldStaticTransform<T> getStaticTransform(FieldAbsoluteDate<T> date) {
  92.         return getTransform(date).toStaticTransform();
  93.     }

  94. }