Interface BoundaryReadHandler<H extends HyperplaneConvexSubset<?>,B extends BoundarySource<H>>
-
- Type Parameters:
H
- Geometric boundary typeB
- Boundary source type
- All Known Subinterfaces:
BoundaryReadHandler3D
- All Known Implementing Classes:
AbstractBoundaryReadHandler3D
,CsvBoundaryReadHandler3D
,ObjBoundaryReadHandler3D
,StlBoundaryReadHandler3D
,TextBoundaryReadHandler3D
public interface BoundaryReadHandler<H extends HyperplaneConvexSubset<?>,B extends BoundarySource<H>>
Basic interface for reading geometric boundary representations (B-reps) from a specific data storage format. This interface is intended primarily for use withBoundaryIOManager
.Implementation note: implementations of this interface must be thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.stream.Stream<H>
boundaries(GeometryInput in, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return aStream
that can be used to access all boundary information from the given input, which is expected to contain data in the format supported by this handler.GeometryFormat
getFormat()
Get thedata format
supported by this handler.B
read(GeometryInput input, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return an object containing all boundaries read frominput
using the handler's supported data format.
-
-
-
Method Detail
-
getFormat
GeometryFormat getFormat()
Get thedata format
supported by this handler.- Returns:
- data format supported by this handler
-
read
B read(GeometryInput input, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return an object containing all boundaries read frominput
using the handler's supported data format.- Parameters:
input
- input to read fromprecision
- precision context used for floating point comparisons- Returns:
- object containing all boundaries read from
input
- Throws:
java.lang.IllegalArgumentException
- if mathematically invalid data is encounteredjava.lang.IllegalStateException
- if a data format error occursjava.io.UncheckedIOException
- if an I/O error occurs
-
boundaries
java.util.stream.Stream<H> boundaries(GeometryInput in, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Return aStream
that can be used to access all boundary information from the given input, which is expected to contain data in the format supported by this handler. Unlike theread
method, this method does not require that all input be read immediately and stored in memory (although implementations of this interface are still free to do so). Callers may therefore prefer to use this method in cases where memory usage is a concern or transformations and/or filters must be applied to the boundaries before use.Implementing class will usually keep the source input stream open during stream iteration. Callers should therefore use the returned stream in a try-with-resources statement to ensure that all resources are properly released. Ex:
try (Stream<H> stream = handler.boundaries(in, precision)) { // access stream content }
The following exceptions may be thrown during stream iteration:
IllegalArgumentException
if mathematically invalid data is encounteredIllegalStateException
if a data format error occursUncheckedIOException
if an I/O error occurs
- Parameters:
in
- input to read fromprecision
- precision context used for floating point comparisons- Returns:
- stream providing access to the boundary information from the given input
- Throws:
java.lang.IllegalStateException
- if a data format error occurs during stream creationjava.io.UncheckedIOException
- if an I/O error occurs during stream creation
-
-