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.partitioning;
23  
24  import org.hipparchus.geometry.Space;
25  
26  /** Class holding boundary attributes.
27   * <p>This class is used for the attributes associated with the
28   * nodes of region boundary shell trees returned by the {@link
29   * Region#getTree(boolean) Region.getTree(includeBoundaryAttributes)}
30   * when the boolean {@code includeBoundaryAttributes} parameter is
31   * set to {@code true}. It contains the parts of the node cut
32   * sub-hyperplane that belong to the boundary.</p>
33   * <p>This class is a simple placeholder, it does not provide any
34   * processing methods.</p>
35   * @param <S> Type of the space.
36   * @see Region#getTree
37   */
38  public class BoundaryAttribute<S extends Space> {
39  
40      /** Part of the node cut sub-hyperplane that belongs to the
41       * boundary and has the outside of the region on the plus side of
42       * its underlying hyperplane (may be null).
43       */
44      private final SubHyperplane<S> plusOutside;
45  
46      /** Part of the node cut sub-hyperplane that belongs to the
47       * boundary and has the inside of the region on the plus side of
48       * its underlying hyperplane (may be null).
49       */
50      private final SubHyperplane<S> plusInside;
51  
52      /** Sub-hyperplanes that were used to split the boundary part. */
53      private final NodesSet<S> splitters;
54  
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 SubHyperplane<S> plusOutside,
66                        final SubHyperplane<S> plusInside,
67                        final NodesSet<S> splitters) {
68          this.plusOutside = plusOutside;
69          this.plusInside  = plusInside;
70          this.splitters   = splitters;
71      }
72  
73      /** Get the part of the node cut sub-hyperplane that belongs to the
74       * boundary and has the outside of the region on the plus side of
75       * its underlying hyperplane.
76       * @return part of the node cut sub-hyperplane that belongs to the
77       * boundary and has the outside of the region on the plus side of
78       * its underlying hyperplane
79       */
80      public SubHyperplane<S> getPlusOutside() {
81          return plusOutside;
82      }
83  
84      /** Get the part of the node cut sub-hyperplane that belongs to the
85       * boundary and has the inside of the region on the plus side of
86       * its underlying hyperplane.
87       * @return part of the node cut sub-hyperplane that belongs to the
88       * boundary and has the inside of the region on the plus side of
89       * its underlying hyperplane
90       */
91      public SubHyperplane<S> getPlusInside() {
92          return plusInside;
93      }
94  
95      /** Get the sub-hyperplanes that were used to split the boundary part.
96       * @return sub-hyperplanes that were used to split the boundary part
97       */
98      public NodesSet<S> getSplitters() {
99          return splitters;
100     }
101 
102 }