Package com.irurueta.geometry.io
Class LoaderBinaryTest
java.lang.Object
com.irurueta.geometry.io.LoaderBinaryTest
- All Implemented Interfaces:
LoaderListener,LoaderListenerBinary,LoaderListenerOBJ,MaterialLoaderListener,MeshWriterListener
class LoaderBinaryTest
extends Object
implements LoaderListenerBinary, LoaderListenerOBJ, MaterialLoaderListener, MeshWriterListener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprivate voidcheckChunkEqualness(DataChunk chunk, DataChunk otherChunk) private voidconvertToBin(File inputFile, File outputFile, MeshFormat inputFormat) private booleanprivate booleanprivate booleanprivate booleanvoidonChunkAvailable(MeshWriter writer, DataChunk chunk) voidonDidValidateTexture(MeshWriter writer, File f) voidvoidonLoadEnd(MaterialLoader loader) voidonLoadProgressChange(Loader loader, float progress) voidonLoadStart(Loader loader) voidonLoadStart(MaterialLoader loader) onMaterialFileRequested(MeshWriter writer, String path) onMaterialLoaderRequested(LoaderOBJ loader, String path) booleanonTextureDataAvailable(LoaderBinary loader, File textureFile, int textureId, int textureImageWidth, int textureImageHeight) onTextureDataAvailable(MeshWriter writer, File textureFile, int textureWidth, int textureHeight) voidonTextureDataProcessed(MeshWriter writer, File textureFile, int textureWidth, int textureHeight) onTextureReceived(LoaderBinary loader, int textureId, int textureImageWidth, int textureImageHeight) onTextureReceived(MeshWriter writer, int textureWidth, int textureHeight) booleanonValidateTexture(MaterialLoader loader, Texture texture) onValidateTexture(MeshWriter writer, Texture texture) voidonWriteEnd(MeshWriter writer) voidonWriteProgressChange(MeshWriter writer, float progress) voidonWriteStart(MeshWriter writer) private void(package private) static void(package private) static void(package private) void(package private) void(package private) void(package private) void(package private) voidtestLoad()(package private) voidtestLoadAndIterate(String inputFile, String binFile) (package private) void(package private) voidprivate voidtestLocked(LoaderBinary loader)
-
Field Details
-
BUFFER_SIZE
private static final int BUFFER_SIZE- See Also:
-
INPUT_FOLDER
- See Also:
-
TMP_FOLDER
- See Also:
-
startValid
private boolean startValid -
endValid
private boolean endValid -
progressValid
private boolean progressValid -
lockedValid
private boolean lockedValid -
startCounter
private int startCounter -
endCounter
private int endCounter -
previousProgress
private float previousProgress -
saveChunks
private boolean saveChunks -
chunks
-
objTextures
-
binTextures
-
-
Constructor Details
-
LoaderBinaryTest
LoaderBinaryTest()
-
-
Method Details
-
setUpClass
@BeforeAll static void setUpClass() -
tearDownClass
@AfterAll static void tearDownClass() -
testConstructors
@Test void testConstructors() throws LockedException, IOException, LoaderException, NotReadyException -
testHasSetFileAndIsReady
@Test void testHasSetFileAndIsReady() throws LockedException, IOException, LoaderException, NotReadyException -
testGetSetListener
- Throws:
LockedExceptionIOException
-
testIsValidFile
@Test void testIsValidFile() throws IOException, LockedException, LoaderException, NotReadyException -
testLoad
-
testLoadAndIterate
@ParameterizedTest(name="{index} => inputFile={0}, binFile={1}") @CsvSource({"randomBig.ply,randomBig.bin","pilarBigEndian.ply,pilarBigEndian.bin","booksBinary.ply,booksBinary.bin"}) void testLoadAndIterate(String inputFile, String binFile) throws IOException, LockedException, NotReadyException, LoaderException, NotAvailableException -
testLoadAndIterateRealFileWithNormals2
@Test void testLoadAndIterateRealFileWithNormals2() throws IOException, LockedException, NotReadyException, LoaderException, NotAvailableException -
testLoadAndIterateRealFileWithTextures
@Test void testLoadAndIterateRealFileWithTextures() throws IOException, LockedException, NotReadyException, LoaderException, NotAvailableException -
checkChunkEqualness
-
onMaterialLoaderRequested
- Specified by:
onMaterialLoaderRequestedin interfaceLoaderListenerOBJ
-
onLoadStart
- Specified by:
onLoadStartin interfaceMaterialLoaderListener
-
onLoadEnd
- Specified by:
onLoadEndin interfaceMaterialLoaderListener
-
onValidateTexture
- Specified by:
onValidateTexturein interfaceMaterialLoaderListener
-
onTextureReceived
public File onTextureReceived(LoaderBinary loader, int textureId, int textureImageWidth, int textureImageHeight) - Specified by:
onTextureReceivedin interfaceLoaderListenerBinary
-
onTextureDataAvailable
public boolean onTextureDataAvailable(LoaderBinary loader, File textureFile, int textureId, int textureImageWidth, int textureImageHeight) - Specified by:
onTextureDataAvailablein interfaceLoaderListenerBinary
-
onLoadStart
- Specified by:
onLoadStartin interfaceLoaderListener
-
onLoadEnd
- Specified by:
onLoadEndin interfaceLoaderListener
-
onLoadProgressChange
- Specified by:
onLoadProgressChangein interfaceLoaderListener
-
onWriteStart
- Specified by:
onWriteStartin interfaceMeshWriterListener
-
onWriteEnd
- Specified by:
onWriteEndin interfaceMeshWriterListener
-
onWriteProgressChange
- Specified by:
onWriteProgressChangein interfaceMeshWriterListener
-
onChunkAvailable
- Specified by:
onChunkAvailablein interfaceMeshWriterListener
-
onMaterialFileRequested
- Specified by:
onMaterialFileRequestedin interfaceMeshWriterListener
-
onValidateTexture
- Specified by:
onValidateTexturein interfaceMeshWriterListener
-
onDidValidateTexture
- Specified by:
onDidValidateTexturein interfaceMeshWriterListener
-
onTextureReceived
- Specified by:
onTextureReceivedin interfaceMeshWriterListener
-
onTextureDataAvailable
public File onTextureDataAvailable(MeshWriter writer, File textureFile, int textureWidth, int textureHeight) - Specified by:
onTextureDataAvailablein interfaceMeshWriterListener
-
onTextureDataProcessed
public void onTextureDataProcessed(MeshWriter writer, File textureFile, int textureWidth, int textureHeight) - Specified by:
onTextureDataProcessedin interfaceMeshWriterListener
-
testLocked
-
resetListener
private void resetListener() -
isStartValid
private boolean isStartValid() -
isEndValid
private boolean isEndValid() -
isProgressValid
private boolean isProgressValid() -
isLockedValid
private boolean isLockedValid() -
areEqual
- Throws:
IOException
-
convertToBin
private void convertToBin(File inputFile, File outputFile, MeshFormat inputFormat) throws IOException, LockedException, LoaderException, NotReadyException
-