1   /* Copyright 2013-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.rugged.intersection;
18  
19  import org.hipparchus.geometry.euclidean.threed.Vector3D;
20  import org.orekit.rugged.api.AlgorithmId;
21  import org.orekit.rugged.utils.ExtendedEllipsoid;
22  import org.orekit.rugged.utils.NormalizedGeodeticPoint;
23  
24  /** Interface for Digital Elevation Model intersection algorithm.
25   * @author Luc Maisonobe
26   * @author Guylaine Prat
27   */
28  public interface IntersectionAlgorithm {
29  
30      /** Compute intersection of line with Digital Elevation Model.
31       * @param ellipsoid reference ellipsoid
32       * @param position pixel position in ellipsoid frame
33       * @param los pixel line-of-sight in ellipsoid frame
34       * @return point at which the line first enters ground
35       */
36      NormalizedGeodeticPoint intersection(ExtendedEllipsoid ellipsoid, Vector3D position, Vector3D los);
37  
38      /** Refine intersection of line with Digital Elevation Model.
39       * <p>
40       * This method is used to refine an intersection when a close guess is
41       * already known. The intersection is typically looked for by a direct
42       * {@link org.orekit.rugged.raster.Tile#cellIntersection(NormalizedGeodeticPoint,
43       * Vector3D, int, int) cell intersection} in the tile which already
44       * contains the close guess, or any similar very fast algorithm.
45       * </p>
46       * @param ellipsoid reference ellipsoid
47       * @param position pixel position in ellipsoid frame
48       * @param los pixel line-of-sight in ellipsoid frame
49       * @param closeGuess guess close to the real intersection
50       * @return point at which the line first enters ground
51       */
52      NormalizedGeodeticPoint refineIntersection(ExtendedEllipsoid ellipsoid, Vector3D position, Vector3D los,
53                                                 NormalizedGeodeticPoint closeGuess);
54  
55      /** Get elevation at a given ground point.
56       * @param latitude ground point latitude
57       * @param longitude ground point longitude
58       * @return elevation at specified point
59       */
60      double getElevation(double latitude, double longitude);
61  
62      /** Get the algorithmId.
63       * @return the algorithmId
64       * @since 2.2
65       */
66      AlgorithmId getAlgorithmId();
67  }