diff --git a/rugged-core/src/main/java/org/orekit/rugged/core/IgnoreDEMAlgorithm.java b/rugged-core/src/main/java/org/orekit/rugged/core/IgnoreDEMAlgorithm.java new file mode 100644 index 0000000000000000000000000000000000000000..a17d742bbbe3e9c9f85a390bcf93c669526f2a77 --- /dev/null +++ b/rugged-core/src/main/java/org/orekit/rugged/core/IgnoreDEMAlgorithm.java @@ -0,0 +1,59 @@ +/* Copyright 2013-2014 CS Systèmes d'Information + * Licensed to CS Systèmes d'Information (CS) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * CS licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.orekit.rugged.core; + +import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; +import org.orekit.bodies.GeodeticPoint; +import org.orekit.errors.OrekitException; +import org.orekit.rugged.api.RuggedException; +import org.orekit.rugged.api.TileUpdater; +import org.orekit.rugged.core.dem.IntersectionAlgorithm; + +/** Intersection ignoring Digital Elevation Model. + * <p> + * This dummy implementation simply uses the ellipsoid itself. + * </p> + * @author Luc Maisonobe + */ +public class IgnoreDEMAlgorithm implements IntersectionAlgorithm { + + /** Simple constructor. + */ + public IgnoreDEMAlgorithm() { + } + + /** {@inheritDoc} */ + @Override + public void setUpTilesManagement(final TileUpdater updater, final int maxCachedTiles) { + // we ignore the DEM + } + + /** {@inheritDoc} */ + @Override + public GeodeticPoint intersection(final ExtendedEllipsoid ellipsoid, + final Vector3D position, final Vector3D los) + throws RuggedException { + try { + return ellipsoid.transform(ellipsoid.pointAtAltitude(position, los, 0.0), + ellipsoid.getBodyFrame(), null); + } catch (OrekitException oe) { + // this should never happen + throw new RuggedException(oe, oe.getSpecifier(), oe.getParts()); + } + } + +} diff --git a/rugged-core/src/main/java/org/orekit/rugged/core/dem/IntersectionAlgorithm.java b/rugged-core/src/main/java/org/orekit/rugged/core/dem/IntersectionAlgorithm.java index d50fc05176924a06b3acaa5f5718c124c3963158..7eed2dba71810399926240a0434620ed413e3450 100644 --- a/rugged-core/src/main/java/org/orekit/rugged/core/dem/IntersectionAlgorithm.java +++ b/rugged-core/src/main/java/org/orekit/rugged/core/dem/IntersectionAlgorithm.java @@ -18,10 +18,11 @@ package org.orekit.rugged.core.dem; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.orekit.bodies.GeodeticPoint; -import org.orekit.rugged.api.GroundPoint; +import org.orekit.rugged.api.RuggedException; import org.orekit.rugged.api.TileUpdater; +import org.orekit.rugged.core.ExtendedEllipsoid; -/** Interface for Digital Elevation Model algorithm. +/** Interface for Digital Elevation Model intersection algorithm. * @author Luc Maisonobe */ public interface IntersectionAlgorithm { @@ -33,12 +34,13 @@ public interface IntersectionAlgorithm { void setUpTilesManagement(TileUpdater updater, int maxCachedTiles); /** Compute intersection of line with Digital Elevation Model. - * @param latitude latitude of line arrival at zero altitude - * @param longitude longitude of line arrival at zero altitude - * @param direction arrival direction in (East, North, Zenith) frame - * (the direction is from spacecraft to ground) + * @param ellipsoid reference ellipsoid + * @param position pixel position in ellipsoid frame + * @param los pixel line-of-sight in ellipsoid frame * @return point at which the line first enters ground + * @exception RuggedException if intersection cannot be found */ - GroundPoint intersection(double latitude0, double longitude0, Vector3D direction); + GeodeticPoint intersection(ExtendedEllipsoid ellipsoid, Vector3D position, Vector3D los) + throws RuggedException; } diff --git a/rugged-core/src/main/java/org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java b/rugged-core/src/main/java/org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java index 102dd9b3cdbd838068f291de04a8c7f2ae1c9fdc..6713007a44d32d866515ef7ecae88149a4a1090f 100644 --- a/rugged-core/src/main/java/org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java +++ b/rugged-core/src/main/java/org/orekit/rugged/core/duvenhage/DuvenhageAlgorithm.java @@ -17,12 +17,13 @@ package org.orekit.rugged.core.duvenhage; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; -import org.orekit.rugged.api.GroundPoint; +import org.orekit.bodies.GeodeticPoint; import org.orekit.rugged.api.TileUpdater; +import org.orekit.rugged.core.ExtendedEllipsoid; import org.orekit.rugged.core.dem.IntersectionAlgorithm; import org.orekit.rugged.core.dem.TilesCache; -/** Direct and inverse localization using Duvenhage's algorithm. +/** Digital Elevation Model intersection using Duvenhage's algorithm. * <p> * The algorithm is described in the 2009 paper: * <a href="http://researchspace.csir.co.za/dspace/bitstream/10204/3041/1/Duvenhage_2009.pdf">Using @@ -49,7 +50,8 @@ public class DuvenhageAlgorithm implements IntersectionAlgorithm { /** {@inheritDoc} */ @Override - public GroundPoint intersection(final double latitude0, final double longitude0, final Vector3D direction) { + public GeodeticPoint intersection(final ExtendedEllipsoid ellipsoid, + final Vector3D position, final Vector3D los) { // TODO: compute intersection return null; }