Skip to content

Commit

Permalink
removing all print statements from teh running code entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Oct 27, 2024
1 parent 0b9bb8f commit 3a4ed88
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 905 deletions.
8 changes: 4 additions & 4 deletions src/main/java/eu/mihosoft/vrl/v3d/JavaFXInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public JavaFXInitializer(){
}
private static void gointernal() {
if(latch.getCount()!=NUM_COUNT) {
//com.neuronrobotics.sdk.common.Log.error("ERR initializer already started");
//System.out.println("ERR initializer already started");
return;
}
com.neuronrobotics.sdk.common.Log.error("Starting JavaFX initializer..."+JavaFXInitializer.class);
System.out.println("Starting JavaFX initializer..."+JavaFXInitializer.class);
latch.countDown();
try {
final javafx.embed.swing.JFXPanel fxPanel = new javafx.embed.swing.JFXPanel();
Expand All @@ -25,7 +25,7 @@ private static void gointernal() {
}
public static void go() {
if(latch.getCount()!=NUM_COUNT) {
//com.neuronrobotics.sdk.common.Log.error("ERR initializer already started");
//System.out.println("ERR initializer already started");
return;
}
new Thread() {
Expand All @@ -46,7 +46,7 @@ public void run() {
}
StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
StackTraceElement e = stacktrace[2];//maybe this number needs to be corrected
com.neuronrobotics.sdk.common.Log.error("Finished JavaFX initializing! "+e);
System.out.println("Finished JavaFX initializing! "+e);
}

}
4 changes: 2 additions & 2 deletions src/main/java/eu/mihosoft/vrl/v3d/Sphere.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public int getNumSlices() {
*/
public Sphere setNumSlices(int numSlices) {
if(numSlices>(NUM_SLICES*4))
com.neuronrobotics.sdk.common.Log.error("Very large sphere! this may crash!");
System.out.println("Very large sphere! this may crash!");
this.numSlices = numSlices;return this;
}

Expand All @@ -272,7 +272,7 @@ public int getNumStacks() {
*/
public Sphere setNumStacks(int numStacks) {
if(numStacks>(NUM_STACKS*4))
com.neuronrobotics.sdk.common.Log.error("Very large sphere! this may crash!");
System.out.println("Very large sphere! this may crash!");
this.numStacks = numStacks;return this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/eu/mihosoft/vrl/v3d/Vector3d.java
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,10 @@ public Vector3d orthogonal() {
break;

case 3:
com.neuronrobotics.sdk.common.Log.error("This vector is equal to (0,0,0). ");
//com.neuronrobotics.sdk.common.Log.error("This vector is equal to (0,0,0). ");

default:
com.neuronrobotics.sdk.common.Log.error("The orthogonal one is set randomly.");
//com.neuronrobotics.sdk.common.Log.error("The orthogonal one is set randomly.");

o1 = r.nextDouble();
o2 = r.nextDouble();
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/eu/mihosoft/vrl/v3d/ext/imagej/STLLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class STLLoader {
// try {
// sl.parse(stlfile);
// } catch (RuntimeException e) {
// //com.neuronrobotics.sdk.common.Log.error("error reading " + sl.name);
// ////System.out.println("error reading " + sl.name);
// throw e;
// }
// return sl.meshes;
Expand Down Expand Up @@ -89,7 +89,7 @@ public ArrayList<Point3f> parse(File f) throws IOException {
String line = br.readLine();
String[] words = line.trim().split("\\s+");
if (line.indexOf('\0') < 0 && words[0].equalsIgnoreCase("solid")) {
////com.neuronrobotics.sdk.common.Log.error("Looks like an ASCII STL");
//////System.out.println("Looks like an ASCII STL");
parseAscii(f);
br.close();
return vertices;
Expand All @@ -106,11 +106,11 @@ public ArrayList<Point3f> parse(File f) throws IOException {
triangles = (int) (((buffer[83] & 0xff) << 24)
| ((buffer[82] & 0xff) << 16) | ((buffer[81] & 0xff) << 8) | (buffer[80] & 0xff));
if (((f.length() - 84) / 50) == triangles) {
////com.neuronrobotics.sdk.common.Log.error("Looks like a binary STL");
//////System.out.println("Looks like a binary STL");
parseBinary(f);
return vertices;
}
com.neuronrobotics.sdk.common.Log.error("File is not a valid STL");
//System.out.println("File is not a valid STL");

return vertices;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ private void cleanUpRepeatingFramesAndValues() {
if (kvOrig != null) {
kvRemoved++;
if (!kvOrig.getEndValue().equals(kvDup.getEndValue()) && kvOrig.getTarget() == kvDup.getTarget()) {
com.neuronrobotics.sdk.common.Log.error("KeyValues set different values for KeyFrame " + duplicate.getTime() + ":"
+ "\n kvOrig = " + kvOrig + ", \nkvDup = " + kvDup);
// com.neuronrobotics.sdk.common.Log.error("KeyValues set different values for KeyFrame " + duplicate.getTime() + ":"
// + "\n kvOrig = " + kvOrig + ", \nkvDup = " + kvDup);
}
}
}
Expand Down Expand Up @@ -578,7 +578,7 @@ private void parseTimeline() {
if (newKeyValues.isEmpty()) {
if (keyFrame.getOnFinished() == null) {
if (keyFrame.getName() != null) {
com.neuronrobotics.sdk.common.Log.error("Removed KeyFrame with name = " + keyFrame.getName());
//com.neuronrobotics.sdk.common.Log.error("Removed KeyFrame with name = " + keyFrame.getName());
}
timeline.getKeyFrames().remove(i);
i--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public MtlReader(String filename, String parentUrl) {
log("Reading material from filename = " + mtlUrl);
read(mtlUrl.openStream());
} catch (FileNotFoundException ex) {
com.neuronrobotics.sdk.common.Log.error("No material file found for obj. ["+fileUrl+"]");
// com.neuronrobotics.sdk.common.Log.error("No material file found for obj. ["+fileUrl+"]");
} catch (IOException ex) {
ex.printStackTrace();
}
Expand All @@ -87,7 +87,7 @@ public MtlReader(InputStream stream) {
log("Reading material from stream");
read(stream);
} catch (FileNotFoundException ex) {
com.neuronrobotics.sdk.common.Log.error("No material file found for obj. [stream]");
//com.neuronrobotics.sdk.common.Log.error("No material file found for obj. [stream]");
} catch (IOException ex) {
ex.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ private void updateMesh() {
final int pointElementSize = triangleMesh.getPointElementSize();
final int faceElementSize = triangleMesh.getFaceElementSize();
final boolean isWireframe = getDrawMode() == DrawMode.LINE;
if (DEBUG) com.neuronrobotics.sdk.common.Log.error("UPDATE MESH -- "+(isWireframe?"WIREFRAME":"SOLID"));
// if (DEBUG) com.neuronrobotics.sdk.common.Log.error("UPDATE MESH -- "+(isWireframe?"WIREFRAME":"SOLID"));
final int numOfPoints = pmesh.getPoints().size() / pointElementSize;
if (DEBUG) com.neuronrobotics.sdk.common.Log.error("numOfPoints = " + numOfPoints);
//if (DEBUG) com.neuronrobotics.sdk.common.Log.error("numOfPoints = " + numOfPoints);

if(isWireframe) {
// The current triangleMesh implementation gives buggy behavior when the size of faces are shrunken
Expand All @@ -438,19 +438,19 @@ private void updateMesh() {
int facesInd = 0;
int pointsInd = pmesh.getPoints().size();
for(int[] face: pmesh.faces) {
if (DEBUG) com.neuronrobotics.sdk.common.Log.error("face.length = " + (face.length/2)+" -- "+Arrays.toString(face));
// if (DEBUG) com.neuronrobotics.sdk.common.Log.error("face.length = " + (face.length/2)+" -- "+Arrays.toString(face));
int lastPointIndex = face[face.length-2];
if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" lastPointIndex = " + lastPointIndex);
//if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" lastPointIndex = " + lastPointIndex);
for (int p=0;p<face.length;p+=2) {
int pointIndex = face[p];
if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" connecting point["+lastPointIndex+"] to point[" + pointIndex+"]");
// if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" connecting point["+lastPointIndex+"] to point[" + pointIndex+"]");
facesArray[facesInd++] = lastPointIndex;
facesArray[facesInd++] = 0;
facesArray[facesInd++] = pointIndex;
facesArray[facesInd++] = 0;
facesArray[facesInd++] = pointsInd / pointElementSize;
facesArray[facesInd++] = 0;
if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" facesInd = " + facesInd);
//if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" facesInd = " + facesInd);
pointsInd += pointElementSize;
lastPointIndex = pointIndex;
}
Expand Down Expand Up @@ -512,7 +512,7 @@ private void updateMesh() {
for(int f = 0; f < pmesh.faces.length; f++) {
int[] face = pmesh.faces[f];
int currentSmoothGroup = pmesh.getFaceSmoothingGroups().get(f);
if (DEBUG) com.neuronrobotics.sdk.common.Log.error("face.length = " + face.length+" -- "+Arrays.toString(face));
//if (DEBUG) com.neuronrobotics.sdk.common.Log.error("face.length = " + face.length+" -- "+Arrays.toString(face));
int firstPointIndex = face[0];
int firstTexIndex = face[1];
int lastPointIndex = face[2];
Expand Down Expand Up @@ -545,10 +545,10 @@ private void updateMesh() {
}
}

if (DEBUG) com.neuronrobotics.sdk.common.Log.error("CREATING TRIANGLE MESH");
if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" points = "+Arrays.toString(((TriangleMesh) meshView.getMesh()).getPoints().toArray(null)));
if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" texCoords = "+Arrays.toString(((TriangleMesh) meshView.getMesh()).getTexCoords().toArray(null)));
if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" faces = "+Arrays.toString(((TriangleMesh) meshView.getMesh()).getFaces().toArray(null)));
// if (DEBUG) com.neuronrobotics.sdk.common.Log.error("CREATING TRIANGLE MESH");
// if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" points = "+Arrays.toString(((TriangleMesh) meshView.getMesh()).getPoints().toArray(null)));
// if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" texCoords = "+Arrays.toString(((TriangleMesh) meshView.getMesh()).getTexCoords().toArray(null)));
// if (DEBUG) com.neuronrobotics.sdk.common.Log.error(" faces = "+Arrays.toString(((TriangleMesh) meshView.getMesh()).getFaces().toArray(null)));

if (meshView.getMesh() != triangleMesh) {
meshView.setMesh(triangleMesh);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public void triangulate (FaceList newFaces, double minArea)
face0 = face;
}
}catch(Throwable t) {
com.neuronrobotics.sdk.common.Log.error("Face processing threw exception");
//com.neuronrobotics.sdk.common.Log.error("Face processing threw exception");
t.printStackTrace();
}
}
Expand Down
71 changes: 0 additions & 71 deletions src/main/java/eu/mihosoft/vrl/v3d/ext/quickhull3d/QhullTest.java

This file was deleted.

Loading

0 comments on commit 3a4ed88

Please sign in to comment.