Package com.irurueta.geometry.io
Class MeshWriterBinary
java.lang.Object
com.irurueta.geometry.io.MeshWriter
com.irurueta.geometry.io.MeshWriterBinary
Reads a 3D object and converts it into custom binary format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBuffer size to write data into output stream.private DataOutputStreamStream to write binary data to output.static final byteVersion of the binary file supported by this class.Fields inherited from class com.irurueta.geometry.io.MeshWriter
ignoreTextureValidation, internalListeners, listener, loader, locked, stream -
Constructor Summary
ConstructorsConstructorDescriptionMeshWriterBinary(Loader loader, OutputStream stream) Constructor.MeshWriterBinary(Loader loader, OutputStream stream, MeshWriterListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprocessTextureFile(Texture texture, File textureFile) Processes texture file.voidwrite()Processes input file provided to loader and writes it trans-coded into output stream.Methods inherited from class com.irurueta.geometry.io.MeshWriter
getListener, getStream, isLocked, isReady, setListener
-
Field Details
-
VERSION
public static final byte VERSIONVersion of the binary file supported by this class.- See Also:
-
BUFFER_SIZE
public static final int BUFFER_SIZEBuffer size to write data into output stream.- See Also:
-
dataStream
Stream to write binary data to output.
-
-
Constructor Details
-
MeshWriterBinary
Constructor.- Parameters:
loader- loader to load a 3D file.stream- stream where trans-coded data will be written to.
-
MeshWriterBinary
Constructor.- Parameters:
loader- loader to load a 3D file.stream- stream where trans-coded data will be written to.listener- listener to be notified of progress changes or when transcoding process starts or finishes.
-
-
Method Details
-
write
Processes input file provided to loader and writes it trans-coded into output stream.- Specified by:
writein classMeshWriter- Throws:
LoaderException- if 3D file loading fails.IOException- if an I/O error occurs.NotReadyException- if mesh writer is not ready because either a loader has not been provided or an output stream has not been provided.LockedException- if this mesh writer is locked processing a file.
-
processTextureFile
Processes texture file. By reading provided texture file that has been created in a temporal location and embedding it into resulting output stream.- Specified by:
processTextureFilein classMeshWriter- Parameters:
texture- reference to texture that uses texture image.textureFile- file containing texture image. File will usually be created in a temporal location.- Throws:
IOException- if an I/O error occurs.
-