1 /* Copyright 2002-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.bodies; 18 19 import java.io.Serializable; 20 21 import org.hipparchus.RealFieldElement; 22 import org.hipparchus.geometry.euclidean.threed.FieldLine; 23 import org.hipparchus.geometry.euclidean.threed.FieldVector3D; 24 import org.hipparchus.geometry.euclidean.threed.Line; 25 import org.hipparchus.geometry.euclidean.threed.Vector3D; 26 import org.orekit.frames.Frame; 27 import org.orekit.time.AbsoluteDate; 28 import org.orekit.time.FieldAbsoluteDate; 29 import org.orekit.utils.TimeStampedPVCoordinates; 30 31 32 /** Interface representing the rigid surface shape of a natural body. 33 * <p>The shape is not provided as a single complete geometric 34 * model, but single points can be queried ({@link #getIntersectionPoint}).</p> 35 * @author Luc Maisonobe 36 */ 37 public interface BodyShape extends Serializable { 38 39 /** Get body frame related to body shape. 40 * @return body frame related to body shape 41 */ 42 Frame getBodyFrame(); 43 44 /** Get the intersection point of a line with the surface of the body. 45 * <p>A line may have several intersection points with a closed 46 * surface (we consider the one point case as a degenerated two 47 * points case). The close parameter is used to select which of 48 * these points should be returned. The selected point is the one 49 * that is closest to the close point.</p> 50 * @param line test line (may intersect the body or not) 51 * @param close point used for intersections selection 52 * @param frame frame in which line is expressed 53 * @param date date of the line in given frame 54 * @return intersection point at altitude zero or null if the line does 55 * not intersect the surface 56 */ 57 GeodeticPoint getIntersectionPoint(Line line, Vector3D close, 58 Frame frame, AbsoluteDate date); 59 60 /** Get the intersection point of a line with the surface of the body. 61 * <p>A line may have several intersection points with a closed 62 * surface (we consider the one point case as a degenerated two 63 * points case). The close parameter is used to select which of 64 * these points should be returned. The selected point is the one 65 * that is closest to the close point.</p> 66 * @param line test line (may intersect the body or not) 67 * @param close point used for intersections selection 68 * @param frame frame in which line is expressed 69 * @param date date of the line in given frame 70 * @param <T> type of the field elements 71 * @return intersection point at altitude zero or null if the line does 72 * not intersect the surface 73 * @since 9.0 74 */ 75 <T extends RealFieldElement<T>> FieldGeodeticPoint<T> getIntersectionPoint(FieldLine<T> line, FieldVector3D<T> close, 76 Frame frame, FieldAbsoluteDate<T> date); 77 78 /** Project a point to the ground. 79 * @param point point to project 80 * @param date current date 81 * @param frame frame in which moving point is expressed 82 * @return ground point exactly at the local vertical of specified point, 83 * in the same frame as specified point 84 * @see #projectToGround(TimeStampedPVCoordinates, Frame) 85 * @since 7.0 86 */ 87 Vector3D projectToGround(Vector3D point, AbsoluteDate date, Frame frame); 88 89 /** Project a moving point to the ground. 90 * @param pv moving point 91 * @param frame frame in which moving point is expressed 92 * @return ground point exactly at the local vertical of specified point, 93 * in the same frame as specified point 94 * @see #projectToGround(Vector3D, AbsoluteDate, Frame) 95 * @since 7.0 96 */ 97 TimeStampedPVCoordinatess/TimeStampedPVCoordinates.html#TimeStampedPVCoordinates">TimeStampedPVCoordinates projectToGround(TimeStampedPVCoordinates pv, Frame frame); 98 99 /** Transform a Cartesian point to a surface-relative point. 100 * @param point Cartesian point 101 * @param frame frame in which Cartesian point is expressed 102 * @param date date of the computation (used for frames conversions) 103 * @return point at the same location but as a surface-relative point 104 */ 105 GeodeticPoint transform(Vector3D point, Frame frame, AbsoluteDate date); 106 107 /** Transform a Cartesian point to a surface-relative point. 108 * @param point Cartesian point 109 * @param <T> type fo the filed elements 110 * @param frame frame in which Cartesian point is expressed 111 * @param date date of the computation (used for frames conversions) 112 * @return point at the same location but as a surface-relative point 113 * @since 9.0 114 */ 115 <T extends RealFieldElement<T>> FieldGeodeticPoint<T> transform(FieldVector3D<T> point, Frame frame, 116 FieldAbsoluteDate<T> date); 117 118 /** Transform a surface-relative point to a Cartesian point. 119 * @param point surface-relative point 120 * @return point at the same location but as a Cartesian point 121 */ 122 Vector3D transform(GeodeticPoint point); 123 124 /** Transform a surface-relative point to a Cartesian point. 125 * @param point surface-relative point 126 * @param <T> type fo the filed elements 127 * @return point at the same location but as a Cartesian point 128 * @since 9.0 129 */ 130 <T extends RealFieldElement<T>> FieldVector3D<T> transform(FieldGeodeticPoint<T> point); 131 132 }