TData - TPoint - TBoundary - public interface IBspStrategy<TData,TBoundary>
Strategy tells BspTree how to partition space/data. For example a 3D tree using planes to partition the space needs to know
when to split a leaf node (shouldSplit(IConstBspLeafNode)), what planes should be used (findBoundary(IConstBspLeafNode)) and
then how to split the data (splitData(Object, Object)).
| Modifier and Type | Method and Description |
|---|---|
TBoundary |
findBoundary(IConstBspLeafNode<TData,TBoundary> leafNode)
Find a boundary to split a leaf node
|
TData |
joinData(TData data1,
TData data2)
Join data
|
TData |
removeData(TData data,
TData dataToRemove)
Remove data
Required for
BspTree.removeData(Object), may throw UnsupportedOperationException if removal is not required. |
boolean |
shouldSplit(IConstBspLeafNode<TData,TBoundary> leafNode)
Whether a leaf node should be split
|
SplitData<TData> |
splitData(TBoundary boundary,
TData data)
Split data according to a boundary
Depending on the nature of the data this can be done multiple ways.
|
boolean shouldSplit(IConstBspLeafNode<TData,TBoundary> leafNode)
leafNode - tested leaf nodeTBoundary findBoundary(IConstBspLeafNode<TData,TBoundary> leafNode)
leafNode - leaf node to splitSplitData<TData> splitData(TBoundary boundary, TData data)
Depending on the nature of the data this can be done multiple ways. For all purposes the sum of partitioned data must be equivalent to the original data and for best results each half should contain only those bits that are relevant to that half.
For example, if the data is composed of elements then elements that span both across the boundary should be included in both the positive and the negative part. Elements that belong to only one side should be added only to the respective side.
boundary - boundary used to split the datadata - data to splitTData joinData(TData data1, TData data2)
data1 - data, ignored if nulldata2 - data, ignored if nullTData removeData(TData data, TData dataToRemove)
Required for BspTree.removeData(Object), may throw UnsupportedOperationException if removal is not required.
data - data to remove fromdataToRemove - what to removeCopyright © 2019 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.