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 with
BoundaryIOManager.
Implementation note: implementations of this interface must be thread-safe.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboundaries(GeometryInput in, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return aStreamthat 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.Get thedata formatsupported by this handler.read(GeometryInput input, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return an object containing all boundaries read frominputusing the handler's supported data format.
-
Method Details
-
getFormat
GeometryFormat getFormat()Get thedata formatsupported by this handler.- Returns:
- data format supported by this handler
-
read
Return an object containing all boundaries read frominputusing 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:
IllegalArgumentException- if mathematically invalid data is encounteredIllegalStateException- if a data format error occursUncheckedIOException- if an I/O error occurs
-
boundaries
Stream<H> boundaries(GeometryInput in, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return aStreamthat 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 thereadmethod, 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:
IllegalArgumentExceptionif mathematically invalid data is encounteredIllegalStateExceptionif a data format error occursUncheckedIOExceptionif 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:
IllegalStateException- if a data format error occurs during stream creationUncheckedIOException- if an I/O error occurs during stream creation
-