BoundaryAttribute.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.partitioning;

  22. import org.hipparchus.geometry.Point;
  23. import org.hipparchus.geometry.Space;

  24. /** Class holding boundary attributes.
  25.  * <p>This class is used for the attributes associated with the
  26.  * nodes of region boundary shell trees returned by the {@link
  27.  * Region#getTree(boolean) Region.getTree(includeBoundaryAttributes)}
  28.  * when the boolean {@code includeBoundaryAttributes} parameter is
  29.  * set to {@code true}. It contains the parts of the node cut
  30.  * sub-hyperplane that belong to the boundary.</p>
  31.  * <p>This class is a simple placeholder, it does not provide any
  32.  * processing methods.</p>
  33.  * @param <S> Type of the space.
  34.  * @param <P> Type of the points in space.
  35.  * @param <H> Type of the hyperplane.
  36.  * @param <I> Type of the sub-hyperplane.
  37.  * @see Region#getTree
  38.  */
  39. public class BoundaryAttribute<S extends Space,
  40.                                P extends Point<S, P>,
  41.                                H extends Hyperplane<S, P, H, I>,
  42.                                I extends SubHyperplane<S, P, H, I>> {

  43.     /** Part of the node cut sub-hyperplane that belongs to the
  44.      * boundary and has the outside of the region on the plus side of
  45.      * its underlying hyperplane (may be null).
  46.      */
  47.     private final I plusOutside;

  48.     /** Part of the node cut sub-hyperplane that belongs to the
  49.      * boundary and has the inside of the region on the plus side of
  50.      * its underlying hyperplane (may be null).
  51.      */
  52.     private final I plusInside;

  53.     /** Sub-hyperplanes that were used to split the boundary part. */
  54.     private final NodesSet<S, P, H, I> splitters;

  55.     /** Simple constructor.
  56.      * @param plusOutside part of the node cut sub-hyperplane that
  57.      * belongs to the boundary and has the outside of the region on
  58.      * the plus side of its underlying hyperplane (may be null)
  59.      * @param plusInside part of the node cut sub-hyperplane that
  60.      * belongs to the boundary and has the inside of the region on the
  61.      * plus side of its underlying hyperplane (may be null)
  62.      * @param splitters sub-hyperplanes that were used to
  63.      * split the boundary part (may be null)
  64.      */
  65.     BoundaryAttribute(final I plusOutside,
  66.                       final I plusInside,
  67.                       final NodesSet<S, P, H, I> splitters) {
  68.         this.plusOutside = plusOutside;
  69.         this.plusInside  = plusInside;
  70.         this.splitters   = splitters;
  71.     }

  72.     /** Get the part of the node cut sub-hyperplane that belongs to the
  73.      * boundary and has the outside of the region on the plus side of
  74.      * its underlying hyperplane.
  75.      * @return part of the node cut sub-hyperplane that belongs to the
  76.      * boundary and has the outside of the region on the plus side of
  77.      * its underlying hyperplane
  78.      */
  79.     public I getPlusOutside() {
  80.         return plusOutside;
  81.     }

  82.     /** Get the part of the node cut sub-hyperplane that belongs to the
  83.      * boundary and has the inside of the region on the plus side of
  84.      * its underlying hyperplane.
  85.      * @return part of the node cut sub-hyperplane that belongs to the
  86.      * boundary and has the inside of the region on the plus side of
  87.      * its underlying hyperplane
  88.      */
  89.     public I getPlusInside() {
  90.         return plusInside;
  91.     }

  92.     /** Get the sub-hyperplanes that were used to split the boundary part.
  93.      * @return sub-hyperplanes that were used to split the boundary part
  94.      */
  95.     public NodesSet<S, P, H, I> getSplitters() {
  96.         return splitters;
  97.     }

  98. }