Package com.io7m.smfj.frontend
Class SMFFCopier
- java.lang.Object
-
- com.io7m.smfj.frontend.SMFFCopier
-
- All Implemented Interfaces:
SMFFCopierType,SMFParserEventsBodyType,SMFParserEventsDataAttributesNonInterleavedType,SMFParserEventsDataAttributeValuesType,SMFParserEventsDataMetaOptionalSupplierType,SMFParserEventsDataMetaType,SMFParserEventsDataTrianglesType,SMFParserEventsErrorType,SMFParserEventsHeaderType,SMFParserEventsType
public final class SMFFCopier extends java.lang.Object implements SMFFCopierType, SMFParserEventsBodyType, SMFParserEventsHeaderType, SMFParserEventsDataAttributesNonInterleavedType, SMFParserEventsDataTrianglesType, SMFParserEventsDataMetaType, SMFParserEventsDataAttributeValuesType
The default implementation of theSMFFCopierType.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SMFFCopierTypecreate(SMFSerializerType in_serializer)Create a new copier.java.util.List<SMFErrorType>errors()java.util.Optional<SMFParserEventsDataAttributesNonInterleavedType>onAttributesNonInterleaved()voidonDataAttributesNonInterleavedFinish()Called when parsing of all non-interleaved attribute data has finished.java.util.Optional<SMFParserEventsDataAttributeValuesType>onDataAttributeStart(SMFAttribute attribute)Parsing of data for the attribute has started.voidonDataAttributeValueFinish()Parsing of data for the attribute has finished.voidonDataAttributeValueFloat1(double x)A data value has been received.voidonDataAttributeValueFloat2(double x, double y)A data value has been received.voidonDataAttributeValueFloat3(double x, double y, double z)A data value has been received.voidonDataAttributeValueFloat4(double x, double y, double z, double w)A data value has been received.voidonDataAttributeValueIntegerSigned1(long x)A data value has been received.voidonDataAttributeValueIntegerSigned2(long x, long y)A data value has been received.voidonDataAttributeValueIntegerSigned3(long x, long y, long z)A data value has been received.voidonDataAttributeValueIntegerSigned4(long x, long y, long z, long w)A data value has been received.voidonDataAttributeValueIntegerUnsigned1(long x)A data value has been received.voidonDataAttributeValueIntegerUnsigned2(long x, long y)A data value has been received.voidonDataAttributeValueIntegerUnsigned3(long x, long y, long z)A data value has been received.voidonDataAttributeValueIntegerUnsigned4(long x, long y, long z, long w)A data value has been received.voidonDataTriangle(long v0, long v1, long v2)A triangle has been parsed.voidonDataTrianglesFinish()Parsing of triangles has completed.voidonError(SMFErrorType e)An error has occurred.voidonFinish()Parsing has finished.java.util.Optional<SMFParserEventsBodyType>onHeaderParsed(SMFHeader header)Parsing of the header was successful.java.util.Optional<SMFParserEventsDataMetaType>onMeta(SMFSchemaIdentifier schema)voidonMetaData(SMFSchemaIdentifier schema, byte[] data)Metadata is ready for delivery.voidonStart()Parsing has started.java.util.Optional<SMFParserEventsDataTrianglesType>onTriangles()java.util.Optional<SMFParserEventsHeaderType>onVersionReceived(SMFFormatVersion in_version)The file format version has been successfully parsed.voidonWarning(SMFWarningType w)An error has occurred of a severity low enough that it should just be considered a warning.java.util.List<SMFWarningType>warnings()
-
-
-
Method Detail
-
create
public static SMFFCopierType create(SMFSerializerType in_serializer)
Create a new copier.- Parameters:
in_serializer- The serializer- Returns:
- A new copier
-
onStart
public void onStart()
Description copied from interface:SMFParserEventsTypeParsing has started.- Specified by:
onStartin interfaceSMFParserEventsType
-
onVersionReceived
public java.util.Optional<SMFParserEventsHeaderType> onVersionReceived(SMFFormatVersion in_version)
Description copied from interface:SMFParserEventsTypeThe file format version has been successfully parsed. The functions should return a receiver for the header information if parsing should continue, orOptional.empty()if parsing should stop.- Specified by:
onVersionReceivedin interfaceSMFParserEventsType- Parameters:
in_version- The file format version- Returns:
- A receiver for the header, if any
-
onFinish
public void onFinish()
Description copied from interface:SMFParserEventsTypeParsing has finished. This method will be called unconditionally when the parser is closed, regardless of any errors encountered.- Specified by:
onFinishin interfaceSMFParserEventsType
-
onError
public void onError(SMFErrorType e)
Description copied from interface:SMFParserEventsErrorTypeAn error has occurred. Parsing will continue but the file as a whole must be considered invalid.- Specified by:
onErrorin interfaceSMFParserEventsErrorType- Parameters:
e- The error
-
onWarning
public void onWarning(SMFWarningType w)
Description copied from interface:SMFParserEventsErrorTypeAn error has occurred of a severity low enough that it should just be considered a warning.- Specified by:
onWarningin interfaceSMFParserEventsErrorType- Parameters:
w- The warning
-
onDataAttributeStart
public java.util.Optional<SMFParserEventsDataAttributeValuesType> onDataAttributeStart(SMFAttribute attribute)
Description copied from interface:SMFParserEventsDataAttributesNonInterleavedTypeParsing of data for the attribute has started.
This method must return a receiver for the given attribute if it wants to receive values, or
Optional.empty()if it does not.- Specified by:
onDataAttributeStartin interfaceSMFParserEventsDataAttributesNonInterleavedType- Parameters:
attribute- The attribute- Returns:
- A value receiver
-
onDataAttributesNonInterleavedFinish
public void onDataAttributesNonInterleavedFinish()
Description copied from interface:SMFParserEventsDataAttributesNonInterleavedTypeCalled when parsing of all non-interleaved attribute data has finished.- Specified by:
onDataAttributesNonInterleavedFinishin interfaceSMFParserEventsDataAttributesNonInterleavedType
-
onDataAttributeValueIntegerSigned1
public void onDataAttributeValueIntegerSigned1(long x)
Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerSigned1in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x value
-
onDataAttributeValueIntegerSigned2
public void onDataAttributeValueIntegerSigned2(long x, long y)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerSigned2in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y value
-
onDataAttributeValueIntegerSigned3
public void onDataAttributeValueIntegerSigned3(long x, long y, long z)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerSigned3in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y valuez- The z value
-
onDataAttributeValueIntegerSigned4
public void onDataAttributeValueIntegerSigned4(long x, long y, long z, long w)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerSigned4in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y valuez- The z valuew- The w value
-
onDataAttributeValueIntegerUnsigned1
public void onDataAttributeValueIntegerUnsigned1(long x)
Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerUnsigned1in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x value
-
onDataAttributeValueIntegerUnsigned2
public void onDataAttributeValueIntegerUnsigned2(long x, long y)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerUnsigned2in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y value
-
onDataAttributeValueIntegerUnsigned3
public void onDataAttributeValueIntegerUnsigned3(long x, long y, long z)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerUnsigned3in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y valuez- The z value
-
onDataAttributeValueIntegerUnsigned4
public void onDataAttributeValueIntegerUnsigned4(long x, long y, long z, long w)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueIntegerUnsigned4in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y valuez- The z valuew- The w value
-
onDataAttributeValueFloat1
public void onDataAttributeValueFloat1(double x)
Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueFloat1in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x value
-
onDataAttributeValueFloat2
public void onDataAttributeValueFloat2(double x, double y)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueFloat2in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y value
-
onDataAttributeValueFloat3
public void onDataAttributeValueFloat3(double x, double y, double z)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueFloat3in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y valuez- The z value
-
onDataAttributeValueFloat4
public void onDataAttributeValueFloat4(double x, double y, double z, double w)Description copied from interface:SMFParserEventsDataAttributeValuesTypeA data value has been received.- Specified by:
onDataAttributeValueFloat4in interfaceSMFParserEventsDataAttributeValuesType- Parameters:
x- The x valuey- The y valuez- The z valuew- The w value
-
onDataAttributeValueFinish
public void onDataAttributeValueFinish()
Description copied from interface:SMFParserEventsDataAttributeValuesTypeParsing of data for the attribute has finished.- Specified by:
onDataAttributeValueFinishin interfaceSMFParserEventsDataAttributeValuesType
-
onDataTriangle
public void onDataTriangle(long v0, long v1, long v2)Description copied from interface:SMFParserEventsDataTrianglesTypeA triangle has been parsed.- Specified by:
onDataTrianglein interfaceSMFParserEventsDataTrianglesType- Parameters:
v0- The index of the first vertexv1- The index of the second vertexv2- The index of the third vertex
-
onDataTrianglesFinish
public void onDataTrianglesFinish()
Description copied from interface:SMFParserEventsDataTrianglesTypeParsing of triangles has completed.- Specified by:
onDataTrianglesFinishin interfaceSMFParserEventsDataTrianglesType
-
errors
public java.util.List<SMFErrorType> errors()
- Specified by:
errorsin interfaceSMFFCopierType- Returns:
- The list of errors encountered, if any
-
warnings
public java.util.List<SMFWarningType> warnings()
- Specified by:
warningsin interfaceSMFFCopierType- Returns:
- The list of warnings encountered, if any
-
onHeaderParsed
public java.util.Optional<SMFParserEventsBodyType> onHeaderParsed(SMFHeader header)
Description copied from interface:SMFParserEventsHeaderTypeParsing of the header was successful. The function must return an event receiver if it wishes parsing to continue.- Specified by:
onHeaderParsedin interfaceSMFParserEventsHeaderType- Parameters:
header- The parsed header- Returns:
- An event receiver
-
onAttributesNonInterleaved
public java.util.Optional<SMFParserEventsDataAttributesNonInterleavedType> onAttributesNonInterleaved()
- Specified by:
onAttributesNonInterleavedin interfaceSMFParserEventsBodyType- Returns:
- A listener that will receive non-interleaved mesh data
-
onTriangles
public java.util.Optional<SMFParserEventsDataTrianglesType> onTriangles()
- Specified by:
onTrianglesin interfaceSMFParserEventsBodyType- Returns:
- A listener that will receive triangle data
-
onMetaData
public void onMetaData(SMFSchemaIdentifier schema, byte[] data)
Description copied from interface:SMFParserEventsDataMetaTypeMetadata is ready for delivery.- Specified by:
onMetaDatain interfaceSMFParserEventsDataMetaType- Parameters:
schema- The metadata schemadata- The data
-
onMeta
public java.util.Optional<SMFParserEventsDataMetaType> onMeta(SMFSchemaIdentifier schema)
- Specified by:
onMetain interfaceSMFParserEventsDataMetaOptionalSupplierType- Parameters:
schema- The schema ID- Returns:
- A listener that will receive metadata
-
-