Vertex.java

  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.  * This is not the original file distributed by the Apache Software Foundation
  19.  * It has been modified by the Hipparchus project
  20.  */
  21. package org.hipparchus.geometry.spherical.twod;

  22. /** Spherical polygons boundary vertex.
  23.  * @see SphericalPolygonsSet#getBoundaryLoops()
  24.  * @see Edge
  25.  */
  26. public class Vertex {

  27.     /** Vertex location. */
  28.     private final S2Point location;

  29.     /** Incoming edge. */
  30.     private Edge incoming;

  31.     /** Outgoing edge. */
  32.     private Edge outgoing;

  33.     /** Build a non-processed vertex not owned by any node yet.
  34.      * @param location vertex location
  35.      */
  36.     Vertex(final S2Point location) {
  37.         this.location = location;
  38.         this.incoming = null;
  39.         this.outgoing = null;
  40.     }

  41.     /** Get Vertex location.
  42.      * @return vertex location
  43.      */
  44.     public S2Point getLocation() {
  45.         return location;
  46.     }

  47.     /** Set incoming edge.
  48.      * <p>
  49.      * The circle supporting the incoming edge is automatically bound
  50.      * with the instance.
  51.      * </p>
  52.      * @param incoming incoming edge
  53.      */
  54.     void setIncoming(final Edge incoming) {
  55.         this.incoming = incoming;
  56.     }

  57.     /** Get incoming edge.
  58.      * @return incoming edge
  59.      */
  60.     public Edge getIncoming() {
  61.         return incoming;
  62.     }

  63.     /** Set outgoing edge.
  64.      * <p>
  65.      * The circle supporting the outgoing edge is automatically bound
  66.      * with the instance.
  67.      * </p>
  68.      * @param outgoing outgoing edge
  69.      */
  70.     void setOutgoing(final Edge outgoing) {
  71.         this.outgoing = outgoing;
  72.     }

  73.     /** Get outgoing edge.
  74.      * @return outgoing edge
  75.      */
  76.     public Edge getOutgoing() {
  77.         return outgoing;
  78.     }

  79. }