This commit is contained in:
SiboVG 2023-08-16 14:59:47 +02:00
parent 5a5b58e8c2
commit c2a3ebffc3
4 changed files with 19 additions and 12 deletions

View File

@ -37,7 +37,7 @@ import java.util.List;
/** /**
* Default implementation of an Mtl (material) * Default implementation of an Mtl (material)
*/ */
final class DefaultMtl implements Mtl { public final class DefaultMtl implements Mtl {
/** /**
* The name of this material * The name of this material
*/ */
@ -210,7 +210,7 @@ final class DefaultMtl implements Mtl {
* *
* @param name The name of this material * @param name The name of this material
*/ */
DefaultMtl(String name) { public DefaultMtl(String name) {
this.name = name; this.name = name;
this.reflOptions = new ArrayList<TextureOptions>(); this.reflOptions = new ArrayList<TextureOptions>();
} }

View File

@ -79,9 +79,11 @@ public class DefaultMtlWriter {
* *
* @param mtl The {@link Mtl} * @param mtl The {@link Mtl}
* @param writer The writer * @param writer The writer
* @throws IOException If an IO error occurs * @throws IOExcept
*
* ion If an IO error occurs
*/ */
private static void write(Mtl mtl, Writer writer) public static void write(Mtl mtl, Writer writer)
throws IOException { throws IOException {
writer.write(createString(mtl)); writer.write(createString(mtl));
writer.flush(); writer.flush();

View File

@ -36,7 +36,7 @@ import java.util.Objects;
/** /**
* Default implementation of {@link TextureOptions} * Default implementation of {@link TextureOptions}
*/ */
final class DefaultTextureOptions implements TextureOptions { public final class DefaultTextureOptions implements TextureOptions {
/** /**
* The file name * The file name
*/ */
@ -110,7 +110,7 @@ final class DefaultTextureOptions implements TextureOptions {
/** /**
* Default constructor * Default constructor
*/ */
DefaultTextureOptions() { public DefaultTextureOptions() {
// Default constructor // Default constructor
} }

View File

@ -160,22 +160,27 @@ public class OBJExporterFactoryTest {
Path tempFile = Files.createTempFile("testExport", ".obj"); Path tempFile = Files.createTempFile("testExport", ".obj");
String filePath = tempFile.toAbsolutePath().toString(); String filePath = tempFile.toAbsolutePath().toString();
filePath = "/Users/SiboVanGool/Downloads/testExport.obj"; // TODO: remove this line
// Do the exporting // Do the exporting
CoordTransform transformer = new DefaultCoordTransform(rocket.getLength()); OBJExportOptions options = new OBJExportOptions(rocket);
OBJExporterFactory exporterFactory = new OBJExporterFactory(components, rocket.getSelectedConfiguration(), true, false, true, options.setScaling(30);
transformer, filePath); options.setExportChildren(true);
OBJExporterFactory exporterFactory = new OBJExporterFactory(components, rocket.getSelectedConfiguration(), filePath, options);
exporterFactory.doExport(); exporterFactory.doExport();
// Test with other parameters // Test with other parameters
noseCone.setShoulderCapped(false); /*noseCone.setShoulderCapped(false);
railButton.setScrewHeight(0); railButton.setScrewHeight(0);
bodyTube.setFilled(true); bodyTube.setFilled(true);
transformer = new DefaultCoordTransform(rocket.getLength()); transformer = new DefaultCoordTransform(rocket.getLength());
exporterFactory = new OBJExporterFactory(components, rocket.getSelectedConfiguration(), false, false, true, exporterFactory = new OBJExporterFactory(components, rocket.getSelectedConfiguration(), true, false, false,
transformer, filePath); transformer, filePath);
exporterFactory.doExport(); exporterFactory.doExport();*/
// Clean up // Clean up
Files.delete(tempFile); Files.delete(tempFile);