aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2023-03-09 20:01:10 +0100
committerJulien Gouesse <[email protected]>2023-03-09 20:01:10 +0100
commitcd411ffb5f093d1caed80af9df734f6af7f12126 (patch)
tree083d6eaf4e260b32db4290ac45f697d783a909e3
parente7b631c42fc83a6d8a9485a5b6c3d26dbdb5bc76 (diff)
Modifies the log level and uncomments the mesh optimization in the OFF importer
-rw-r--r--ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleOffExample.java2
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDataStore.java2
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDimensionInfo.java2
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffFaceInfo.java2
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffGeometryStore.java4
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffImporter.java13
6 files changed, 12 insertions, 13 deletions
diff --git a/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleOffExample.java b/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleOffExample.java
index 4f27d40..7ba4d2f 100644
--- a/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleOffExample.java
+++ b/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/SimpleOffExample.java
@@ -36,7 +36,7 @@ public class SimpleOffExample extends ExampleBase {
// Load the OFF scene
final long time = System.currentTimeMillis();
final OffImporter importer = new OffImporter();
- final OffGeometryStore storage = importer.load("off/mushroom.off");
+ final OffGeometryStore storage = importer.load("off/socket.off");
System.out.println("Importing Took " + (System.currentTimeMillis() - time) + " ms");
final Node model = storage.getScene();
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDataStore.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDataStore.java
index 5d1a0e3..3876f5c 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDataStore.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDataStore.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2008-2014 Ardor Labs, Inc.
+ * Copyright (c) 2008-2023 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDimensionInfo.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDimensionInfo.java
index 7f11e2b..1bc3db0 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDimensionInfo.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffDimensionInfo.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2008-2014 Ardor Labs, Inc.
+ * Copyright (c) 2008-2023 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffFaceInfo.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffFaceInfo.java
index 8a2ba2e..75fd29b 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffFaceInfo.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffFaceInfo.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2008-2014 Ardor Labs, Inc.
+ * Copyright (c) 2008-2023 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffGeometryStore.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffGeometryStore.java
index 883f068..df4ebca 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffGeometryStore.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffGeometryStore.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2008-2014 Ardor Labs, Inc.
+ * Copyright (c) 2008-2023 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
@@ -240,7 +240,7 @@ public class OffGeometryStore {
}
if (indexModeList.size() == 1) {
- // _geometryTool.minimizeVerts(mesh, matchConditions);
+ _geometryTool.minimizeVerts(mesh, matchConditions);
} else {
// FIXME unsure about minimizeVerts preserving the index modes
}
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffImporter.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffImporter.java
index 32f1fbb..ca2fcb3 100644
--- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffImporter.java
+++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/off/OffImporter.java
@@ -40,7 +40,7 @@ import com.ardor3d.util.resource.ResourceSource;
*
* N.B: supports only the ASCII file format as there's a lack of available binary files to make some tests and the
* specification mentions some constants in the include file named "off.h" but it's not included in Geomview's source
- * code. It supports only 1D, 2D and 3D without homogeneous coordinates.
+ * code. It supports only 1D, 2D and 3D without homogeneous coordinates. It supports only triangles and quads.
*/
public class OffImporter {
@@ -171,7 +171,6 @@ public class OffImporter {
}
final String unhandledFirstParsedValue;
// tries to read an (optional) off keyword
- // FIXME try to read nDim
final OffDimensionInfo offDimensionInfo = new OffDimensionInfo(parser.sval);
if (offDimensionInfo.hasHomogeneousComponent()) {
throw new IOException(
@@ -179,10 +178,10 @@ public class OffImporter {
}
if (offDimensionInfo.isDeduced()) {
// no *off keyword
- OffImporter.LOGGER.log(Level.INFO, "No off keyword on line " + parser.lineno());
+ OffImporter.LOGGER.log(Level.FINE, "No off keyword on line " + parser.lineno());
unhandledFirstParsedValue = parser.sval;
} else {
- OffImporter.LOGGER.log(Level.INFO, parser.sval + " keyword on line " + parser.lineno());
+ OffImporter.LOGGER.log(Level.FINE, parser.sval + " keyword on line " + parser.lineno());
unhandledFirstParsedValue = null;
}
parser.nextToken();
@@ -259,7 +258,7 @@ public class OffImporter {
parser.nextToken();
if (parser.ttype == StreamTokenizer.TT_WORD) {
numberOfEdges = Integer.valueOf(parser.sval);
- OffImporter.LOGGER.log(Level.INFO, "Number of edges: " + numberOfEdges);
+ OffImporter.LOGGER.log(Level.FINE, "Number of edges: " + numberOfEdges);
} else {
throw new IOException(
"Premature end of line, expected three integers vertex_count face_count edge_count");
@@ -318,7 +317,7 @@ public class OffImporter {
}
} while (goOn);
final int colorValuesPerTuple = offDimensionInfo.computeColorValuesPerTuple(valueList.size());
- OffImporter.LOGGER.log(Level.INFO,
+ OffImporter.LOGGER.log(Level.FINE,
"Coords: " + valueList.stream().map(Number::toString).collect(Collectors.joining(" ")));
switch (offDimensionInfo.getVertexValuesPerTuple()) {
case 1:
@@ -427,7 +426,7 @@ public class OffImporter {
throw new IOException(
"Premature end of (face) line, expected at least one value, got zero");
} else {
- OffImporter.LOGGER.log(Level.INFO, "Face coords: "
+ OffImporter.LOGGER.log(Level.FINE, "Face coords: "
+ valueList.stream().map(Number::toString).collect(Collectors.joining(" ")));
// puts the indices into the geometry store
final int vertexIndexCount = valueList.get(0).intValue();