IgnoreDEMAlgorithm.java

  1. /* Copyright 2013-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.rugged.intersection;

  18. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  19. import org.orekit.rugged.api.AlgorithmId;
  20. import org.orekit.rugged.errors.DumpManager;
  21. import org.orekit.rugged.utils.ExtendedEllipsoid;
  22. import org.orekit.rugged.utils.NormalizedGeodeticPoint;

  23. /** Intersection ignoring Digital Elevation Model.
  24.  * <p>
  25.  * This dummy implementation simply uses the ellipsoid itself.
  26.  * </p>
  27.  * @author Luc Maisonobe
  28.  */
  29. public class IgnoreDEMAlgorithm implements IntersectionAlgorithm {

  30.     /** Simple constructor.
  31.      */
  32.     public IgnoreDEMAlgorithm() {
  33.     }

  34.     /** {@inheritDoc} */
  35.     @Override
  36.     public NormalizedGeodeticPoint intersection(final ExtendedEllipsoid ellipsoid,
  37.                                                 final Vector3D position, final Vector3D los) {
  38.         DumpManager.dumpAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID);
  39.         return ellipsoid.pointOnGround(position, los, 0.0);
  40.     }

  41.     /** {@inheritDoc} */
  42.     @Override
  43.     public NormalizedGeodeticPoint refineIntersection(final ExtendedEllipsoid ellipsoid,
  44.                                                       final Vector3D position, final Vector3D los,
  45.                                                       final NormalizedGeodeticPoint closeGuess) {
  46.         DumpManager.dumpAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID);
  47.         return intersection(ellipsoid, position, los);
  48.     }

  49.     /** {@inheritDoc}
  50.      * <p>
  51.      * As this algorithm ignored the Digital Elevation Model,
  52.      * this method always returns 0.0.
  53.      * </p>
  54.      */
  55.     @Override
  56.     public double getElevation(final double latitude, final double longitude) {
  57.         DumpManager.dumpAlgorithm(AlgorithmId.IGNORE_DEM_USE_ELLIPSOID);
  58.         return 0.0;
  59.     }

  60. }