1   /* Copyright 2002-2016 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.geometry.euclidean.threed.Line;
22  import org.hipparchus.geometry.euclidean.threed.Vector3D;
23  import org.orekit.errors.OrekitException;
24  import org.orekit.frames.Frame;
25  import org.orekit.time.AbsoluteDate;
26  import org.orekit.utils.TimeStampedPVCoordinates;
27  
28  
29  /** Interface representing the rigid surface shape of a natural body.
30   * <p>The shape is not provided as a single complete geometric
31   * model, but single points can be queried ({@link #getIntersectionPoint}).</p>
32   * @author Luc Maisonobe
33   */
34  public interface BodyShape extends Serializable {
35  
36      /** Get body frame related to body shape.
37       * @return body frame related to body shape
38       */
39      Frame getBodyFrame();
40  
41      /** Get the intersection point of a line with the surface of the body.
42       * <p>A line may have several intersection points with a closed
43       * surface (we consider the one point case as a degenerated two
44       * points case). The close parameter is used to select which of
45       * these points should be returned. The selected point is the one
46       * that is closest to the close point.</p>
47       * @param line test line (may intersect the body or not)
48       * @param close point used for intersections selection
49       * @param frame frame in which line is expressed
50       * @param date date of the line in given frame
51       * @return intersection point at altitude zero or null if the line does
52       * not intersect the surface
53       * @exception OrekitException if line cannot be converted to body frame
54       */
55      GeodeticPoint getIntersectionPoint(Line line, Vector3D close,
56                                         Frame frame, AbsoluteDate date)
57          throws OrekitException;
58  
59      /** Project a point to the ground.
60       * @param point point to project
61       * @param date current date
62       * @param frame frame in which moving point is expressed
63       * @return ground point exactly at the local vertical of specified point,
64       * in the same frame as specified point
65       * @exception OrekitException if point cannot be converted to body frame
66       * @see #projectToGround(TimeStampedPVCoordinates, Frame)
67       * @since 7.0
68       */
69      Vector3D projectToGround(Vector3D point, AbsoluteDate date, Frame frame)
70          throws OrekitException;
71  
72      /** Project a moving point to the ground.
73       * @param pv moving point
74       * @param frame frame in which moving point is expressed
75       * @return ground point exactly at the local vertical of specified point,
76       * in the same frame as specified point
77       * @exception OrekitException if point cannot be converted to body frame
78       * @see #projectToGround(Vector3D, AbsoluteDate, Frame)
79       * @since 7.0
80       */
81      TimeStampedPVCoordinates projectToGround(TimeStampedPVCoordinates pv, Frame frame)
82          throws OrekitException;
83  
84      /** Transform a cartesian point to a surface-relative point.
85       * @param point cartesian point
86       * @param frame frame in which cartesian point is expressed
87       * @param date date of the computation (used for frames conversions)
88       * @return point at the same location but as a surface-relative point
89       * @exception OrekitException if point cannot be converted to body frame
90       */
91      GeodeticPoint transform(Vector3D point, Frame frame, AbsoluteDate date)
92          throws OrekitException;
93  
94      /** Transform a surface-relative point to a cartesian point.
95       * @param point surface-relative point
96       * @return point at the same location but as a cartesian point
97       */
98      Vector3D transform(GeodeticPoint point);
99  
100 }