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