public final class PgStlbLoader extends PgAbstractLoader
GEOM_DATA_AUTHOR, GEOM_DATA_COLORS, GEOM_DATA_HEADER, GEOM_DATA_INFO, GEOM_DATA_NORMALS, GEOM_DATA_TEXTURE, GEOM_DATA_VECTORS
Constructor and Description |
---|
PgStlbLoader()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isAscii(java.io.BufferedReader in)
Determine if input file is ASCII by checking first word to be "solid".
|
PgJvxSrc[] |
read(java.io.BufferedReader in)
Read an STL geometry file and return an array of new geometries.
|
PgJvxSrc[] |
read(java.io.DataInputStream inReader)
Read an array of geometries from a binary input stream.
|
boolean |
write(java.io.Writer writer,
PgJvxSrc[] geomArr)
Write a single element set into an output stream writer.
|
getAnimations, getDisplayOption, getGeometries, getSpecializedGeometries, isAnimation, isEnabledOptimization, load, setAnimation, setDisplayOption, setGeometryOption, write
public PgJvxSrc[] read(java.io.BufferedReader in)
The returned array of geometry may contain keyframes of
an animation. This is checked with the method isAnimation()
.
Alternatively, one may call load(BuffereredReader) followed by getGeometries() resp. getAnimations() to have a finer control about which information one wants to use from a source. For example, optional display information must be retrieve by a subsequent call getDisplayOption() if available.
read
in interface PgLoaderIf
read
in class PgAbstractLoader
in
- BufferedReader to read textual data from.write(Writer, PgJvxSrc [])
public static boolean isAscii(java.io.BufferedReader in) throws java.io.IOException
Note, reader will return at same read position, typically at the beginning of file.
in
- Buffered reader from current STL filejava.io.IOException
public PgJvxSrc[] read(java.io.DataInputStream inReader)
read
in class PgAbstractLoader
inReader
- Provides all data to this streamPgAbstractLoader.load(BufferedReader)
,
write(Writer, PgJvxSrc [])
public boolean write(java.io.Writer writer, PgJvxSrc[] geomArr) throws java.io.IOException
write
in interface PgLoaderIf
write
in class PgAbstractLoader
writer
- Write all data to this streamgeomArr
- Array with geometries to savetrue
on success.java.io.IOException
read(BufferedReader)
"