public class BoundaryIOManager3D extends BoundaryIOManager<PlaneConvexSubset,BoundarySource3D,BoundaryReadHandler3D,BoundaryWriteHandler3D>
Implementation note:Instances of this class are thread-safe as long as the registered handler instances are thread-safe.
Constructor and Description |
---|
BoundaryIOManager3D() |
Modifier and Type | Method and Description |
---|---|
FacetDefinitionReader |
facetDefinitionReader(GeometryInput in,
GeometryFormat fmt)
Get a
FacetDefinitionReader for reading facet information from the given input. |
Stream<FacetDefinition> |
facets(GeometryInput in,
GeometryFormat fmt)
Return a
Stream providing access to all facets from the given input. |
TriangleMesh |
readTriangleMesh(GeometryInput in,
GeometryFormat fmt,
Precision.DoubleEquivalence precision)
Return a
TriangleMesh containing all triangles from the given input. |
void |
registerDefaultHandlers()
Register default read/write handlers.
|
Stream<Triangle3D> |
triangles(GeometryInput in,
GeometryFormat fmt,
Precision.DoubleEquivalence precision)
Return a
Stream providing access to all triangles from the given input. |
void |
write(Stream<? extends PlaneConvexSubset> boundaries,
GeometryOutput out,
GeometryFormat fmt)
Write all boundaries in the stream to the output.
|
void |
writeFacets(Collection<? extends FacetDefinition> facets,
GeometryOutput out,
GeometryFormat fmt)
Write the given facets to the output.
|
void |
writeFacets(Stream<? extends FacetDefinition> facets,
GeometryOutput out,
GeometryFormat fmt)
Write all facet in the stream to the output.
|
boundaries, getReadFormats, getReadHandlerForFileExtension, getReadHandlerForFormat, getReadHandlers, getWriteFormats, getWriteHandlerForFileExtension, getWriteHandlerForFormat, getWriteHandlers, read, registerReadHandler, registerWriteHandler, requireReadHandler, requireWriteHandler, unregisterReadHandler, unregisterWriteHandler, write
public BoundaryIOManager3D()
public FacetDefinitionReader facetDefinitionReader(GeometryInput in, GeometryFormat fmt)
FacetDefinitionReader
for reading facet information from the given input.in
- input to read facets fromfmt
- format of the input; if null, the format is determined implicitly from the
file extension of the input file name
IllegalArgumentException
- if no read handler can be found for the input formatIllegalStateException
- if a data format error occursUncheckedIOException
- if an I/O error occurspublic Stream<FacetDefinition> facets(GeometryInput in, GeometryFormat fmt)
Stream
providing access to all facets from the given input. The underlying input
stream is closed when the returned stream is closed. Callers should therefore use the returned stream
in a try-with-resources statement to ensure that all resources are properly released.
try (Stream<FacetDefinition> stream = manager.facets(in, fmt)) { // access stream content }
The following exceptions may be thrown during stream iteration:
IllegalStateException
if a data format error occursUncheckedIOException
if an I/O error occursin
- input to read fromfmt
- format of the input; if null, the format is determined implicitly from the
file extension of the input file name
IllegalArgumentException
- if no read handler can be found for the input formatIllegalStateException
- if a data format error occurs during stream creationUncheckedIOException
- if an I/O error occurs during stream creationpublic Stream<Triangle3D> triangles(GeometryInput in, GeometryFormat fmt, Precision.DoubleEquivalence precision)
Stream
providing access to all triangles from the given input. The underlying input
stream is closed when the returned stream is closed. Callers should therefore use the returned stream
in a try-with-resources statement to ensure that all resources are properly released.
try (Stream<Triangle3D> stream = manager.triangles(in, fmt, 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 occursin
- input to read fromfmt
- format of the input; if null, the format is determined implicitly from the
file extension of the input file name
precision
- precision context used for floating point comparisonsIllegalArgumentException
- if no read handler can be found for the input formatIllegalStateException
- if a data format error occurs during stream creationUncheckedIOException
- if an I/O error occurs during stream creationpublic TriangleMesh readTriangleMesh(GeometryInput in, GeometryFormat fmt, Precision.DoubleEquivalence precision)
TriangleMesh
containing all triangles from the given input.in
- input to read fromfmt
- format of the input; if null, the format is determined implicitly from the
file extension of the input file name
precision
- precision context used for floating point comparisonsIllegalArgumentException
- if mathematically invalid data is encountered or no read
handler can be found for the input formatIllegalStateException
- if a data format error occursUncheckedIOException
- if an I/O error occurspublic void write(Stream<? extends PlaneConvexSubset> boundaries, GeometryOutput out, GeometryFormat fmt)
This method does not explicitly close the boundaries
stream. If callers need to ensure that
the stream is closed (for example, if the stream is reading from a file), they should use it in a
try-with-resources statement outside of this method.
boundaries
- stream containing boundaries to writeout
- output to write tofmt
- format of the output; if null, the format is determined implicitly from the
file extension of the output file name
IllegalArgumentException
- if no write handler can be found for the output formatUncheckedIOException
- if an I/O error occurspublic void writeFacets(Stream<? extends FacetDefinition> facets, GeometryOutput out, GeometryFormat fmt)
This method does not explicitly close the boundaries
stream. If callers need to ensure that
the stream is closed (for example, if the stream is reading from a file), they should use it in a
try-with-resources statement outside of this method.
facets
- stream containing facets to writeout
- output to write tofmt
- format of the output; if null, the format is determined implicitly from the
file extension of the output file name
IllegalArgumentException
- if no write handler can be found for the output formatUncheckedIOException
- if an I/O error occurspublic void writeFacets(Collection<? extends FacetDefinition> facets, GeometryOutput out, GeometryFormat fmt)
facets
- facets to writeout
- output to write tofmt
- format of the output; if null, the format is determined implicitly from the
file extension of the output file name
IllegalArgumentException
- if no write handler can be found for the output formatUncheckedIOException
- if an I/O error occurspublic void registerDefaultHandlers()
GeometryFormat3D
.Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.