View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF 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    *      https://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  
18  /*
19   * This is not the original file distributed by the Apache Software Foundation
20   * It has been modified by the Hipparchus project
21   */
22  package org.hipparchus.geometry.spherical.twod;
23  
24  /** Spherical polygons boundary vertex.
25   * @see SphericalPolygonsSet#getBoundaryLoops()
26   * @see Edge
27   */
28  public class Vertex {
29  
30      /** Vertex location. */
31      private final S2Point location;
32  
33      /** Incoming edge. */
34      private Edge incoming;
35  
36      /** Outgoing edge. */
37      private Edge outgoing;
38  
39      /** Build a non-processed vertex not owned by any node yet.
40       * @param location vertex location
41       */
42      Vertex(final S2Point location) {
43          this.location = location;
44          this.incoming = null;
45          this.outgoing = null;
46      }
47  
48      /** Get Vertex location.
49       * @return vertex location
50       */
51      public S2Point getLocation() {
52          return location;
53      }
54  
55      /** Set incoming edge.
56       * <p>
57       * The circle supporting the incoming edge is automatically bound
58       * with the instance.
59       * </p>
60       * @param incoming incoming edge
61       */
62      void setIncoming(final Edge incoming) {
63          this.incoming = incoming;
64      }
65  
66      /** Get incoming edge.
67       * @return incoming edge
68       */
69      public Edge getIncoming() {
70          return incoming;
71      }
72  
73      /** Set outgoing edge.
74       * <p>
75       * The circle supporting the outgoing edge is automatically bound
76       * with the instance.
77       * </p>
78       * @param outgoing outgoing edge
79       */
80      void setOutgoing(final Edge outgoing) {
81          this.outgoing = outgoing;
82      }
83  
84      /** Get outgoing edge.
85       * @return outgoing edge
86       */
87      public Edge getOutgoing() {
88          return outgoing;
89      }
90  
91  }