diff --git a/.gradle/2.0/taskArtifacts/cache.properties.lock b/.gradle/2.0/taskArtifacts/cache.properties.lock index b5e2e96..3d4d344 100644 Binary files a/.gradle/2.0/taskArtifacts/cache.properties.lock and b/.gradle/2.0/taskArtifacts/cache.properties.lock differ diff --git a/.gradle/2.0/taskArtifacts/fileHashes.bin b/.gradle/2.0/taskArtifacts/fileHashes.bin index a11a752..ff60573 100644 Binary files a/.gradle/2.0/taskArtifacts/fileHashes.bin and b/.gradle/2.0/taskArtifacts/fileHashes.bin differ diff --git a/.gradle/2.0/taskArtifacts/fileSnapshots.bin b/.gradle/2.0/taskArtifacts/fileSnapshots.bin index af549a5..6bed971 100644 Binary files a/.gradle/2.0/taskArtifacts/fileSnapshots.bin and b/.gradle/2.0/taskArtifacts/fileSnapshots.bin differ diff --git a/.gradle/2.0/taskArtifacts/taskArtifacts.bin b/.gradle/2.0/taskArtifacts/taskArtifacts.bin index 2067f84..01c0205 100644 Binary files a/.gradle/2.0/taskArtifacts/taskArtifacts.bin and b/.gradle/2.0/taskArtifacts/taskArtifacts.bin differ diff --git a/src/main/java/edu/gcsc/jfx3d/Geometry2D.java b/src/main/java/edu/gcsc/jfx3d/Geometry2D.java index 311374b..126bfdd 100644 --- a/src/main/java/edu/gcsc/jfx3d/Geometry2D.java +++ b/src/main/java/edu/gcsc/jfx3d/Geometry2D.java @@ -5,6 +5,8 @@ */ package edu.gcsc.jfx3d; +import java.util.ArrayList; + /** * * @author Eugen @@ -18,6 +20,7 @@ public abstract class Geometry2D { public abstract void setNodes(int[] array); public abstract int[] getFacesArray(); public abstract int getIndex(); + public abstract String getCoordinatesOfPoints(ArrayList listOfAllVertices); diff --git a/src/main/java/edu/gcsc/jfx3d/Main.java b/src/main/java/edu/gcsc/jfx3d/Main.java index ecf84c4..f46441c 100644 --- a/src/main/java/edu/gcsc/jfx3d/Main.java +++ b/src/main/java/edu/gcsc/jfx3d/Main.java @@ -189,6 +189,7 @@ public Group createContent() { ugxr.setFlagHighResolution(true); ugxr.setFlagDoubleFacesOnEdges(true); ugxr.setFlagRenderFaces(true); + ugxr.setFlagDebugMode(true); ugxGeometry = ugxr.xbuildUGX(); subsetNameArray = ugxr.getSubssetNameArray(); diff --git a/src/main/java/edu/gcsc/jfx3d/Quadrilateral.java b/src/main/java/edu/gcsc/jfx3d/Quadrilateral.java index 7f76b2f..6fc9a44 100644 --- a/src/main/java/edu/gcsc/jfx3d/Quadrilateral.java +++ b/src/main/java/edu/gcsc/jfx3d/Quadrilateral.java @@ -5,6 +5,8 @@ */ package edu.gcsc.jfx3d; +import java.util.ArrayList; + /** * * @author Eugen @@ -43,5 +45,12 @@ public int[] getFacesArray() { return arr; } + public String getCoordinatesOfPoints(ArrayList listOfAllVertices) { + return ("2D Object : " + this.index + " (Part of a quadrilateral)\n"+ + "Vertex 1: " + listOfAllVertices.get(nodes[0]*3) + " " +listOfAllVertices.get(nodes[0]*3+1) + " " + listOfAllVertices.get(nodes[0]*3+2) + "\n" + + "Vertex 2: " + listOfAllVertices.get(nodes[1]*3) + " " +listOfAllVertices.get(nodes[1]*3+1) + " " + listOfAllVertices.get(nodes[1]*3+2) + "\n" + + "Vertex 3: " + listOfAllVertices.get(nodes[2]*3) + " " +listOfAllVertices.get(nodes[2]*3+1) + " " + listOfAllVertices.get(nodes[2]*3+2) + "\n" + + "Vertex 4: " + listOfAllVertices.get(nodes[3]*3) + " " +listOfAllVertices.get(nodes[3]*3+1) + " " + listOfAllVertices.get(nodes[3]*3+2) ); + } } diff --git a/src/main/java/edu/gcsc/jfx3d/Triangle.java b/src/main/java/edu/gcsc/jfx3d/Triangle.java index 3610965..3f71f14 100644 --- a/src/main/java/edu/gcsc/jfx3d/Triangle.java +++ b/src/main/java/edu/gcsc/jfx3d/Triangle.java @@ -5,6 +5,8 @@ */ package edu.gcsc.jfx3d; +import java.util.ArrayList; + /** * * @author Eugen @@ -41,5 +43,13 @@ public int[] getFacesArray() { int[] arr = {this.nodes[0],0,this.nodes[1],0,this.nodes[2],0}; return arr; } + + @Override + public String getCoordinatesOfPoints(ArrayList listOfAllVertices) { + return ("2D Object : " + this.index + "\n"+ + "Vertex 1: " + listOfAllVertices.get(nodes[0]*3) + " " +listOfAllVertices.get(nodes[0]*3+1) + " " + listOfAllVertices.get(nodes[0]*3+2) + "\n" + + "Vertex 2: " + listOfAllVertices.get(nodes[1]*3) + " " +listOfAllVertices.get(nodes[1]*3+1) + " " + listOfAllVertices.get(nodes[1]*3+2) + "\n" + + "Vertex 3: " + listOfAllVertices.get(nodes[2]*3) + " " +listOfAllVertices.get(nodes[2]*3+1) + " " + listOfAllVertices.get(nodes[2]*3+2) + "\n" ); + } } diff --git a/src/main/java/edu/gcsc/jfx3d/UGXReader.java b/src/main/java/edu/gcsc/jfx3d/UGXReader.java index bc58784..5ffa935 100644 --- a/src/main/java/edu/gcsc/jfx3d/UGXReader.java +++ b/src/main/java/edu/gcsc/jfx3d/UGXReader.java @@ -759,7 +759,6 @@ public Group xbuildUGX (){ faceMeshViewArray[j].setCullFace(CullFace.NONE); } - System.out.println("--"); for (int j = triangleMeshList.size(), k = 0; k < quadriMeshList.size(); j++,k++) { faceMeshViewArray[j] = quadriMeshList.get(k); faceMeshViewArray[j].setMaterial(faceMat); @@ -894,7 +893,9 @@ private void addFaceInteraction(Group faceMeshView) { Node pickedNode = mouseClick.getPickResult().getIntersectedNode(); PickResult res = mouseClick.getPickResult(); - System.out.println(newFaceMap.get(pickedNode)); + if (debugMode) { + System.out.println(newFaceMap.get(pickedNode)); + } handleSelection(faceNodeSelection, faceNodeSelectionMaterial, pickedNode, new MeshView()); } @@ -911,8 +912,10 @@ private void addVolumeInteraction(MeshView faceMeshView) { Node pickedNode = mouseClick.getPickResult().getIntersectedNode(); PickResult res = mouseClick.getPickResult(); - System.out.println("Selected node is a volume!"); - System.out.println(newFaceMap.get(pickedNode)); + if (debugMode) { + System.out.println("Selected node is a volume!"); + System.out.println(newFaceMap.get(pickedNode)); + } handleSelection(faceNodeSelection, faceNodeSelectionMaterial, pickedNode, new MeshView()); } @@ -927,8 +930,10 @@ private void addLowResolutionInteraction(Shape3D shape){ if (mouseClick.getButton().toString().matches("SECONDARY")) { Node pickedNode = mouseClick.getPickResult().getIntersectedNode(); - PickResult res = mouseClick.getPickResult(); - System.out.println(pickedNode); + + if (debugMode) { + System.out.println(pickedNode); + } //handleSelection(subsetNodeSelection, subsetNodeSelectionMaterial, pickedNode, new MeshView()); handleLowResolutionSelection(pickedNode); @@ -991,11 +996,13 @@ private void handleLowResolutionSelection(Node pickResult){ } } - System.out.print("\nClicked Subset: "); - System.out.println(subsetMapMeshToSubset.get(pickResult).getSubsetName()); - UGXsubset testss = subsetMapMeshToSubset.get(pickResult); - - System.out.println("Selected subset is split in the following MeshViews " +subsetMapSubsetToMesh.get(testss)); + if (debugMode) { + System.out.print("\nClicked Subset: "); + System.out.println(subsetMapMeshToSubset.get(pickResult).getSubsetName()); + UGXsubset testss = subsetMapMeshToSubset.get(pickResult); + + System.out.println("Selected subset is split in the following MeshViews " + subsetMapSubsetToMesh.get(testss)); + } } private void handleSelection(ArrayList nodeList, ArrayList materialList, Node pickResult, Shape3D geometryType) { @@ -1075,21 +1082,23 @@ private void handleSelection(ArrayList nodeList, ArrayList mater } } - System.out.println("Elements in selection :"); + if (debugMode) { + System.out.println("Elements in selection :"); for (int i = 0; i < nodeList.size(); i++) { - System.out.print(nodeList.get(i) + " "); + System.out.println(nodeList.get(i) + " "); - if (vertexMap.containsKey(pickResult)) { + if (vertexMap.containsKey(pickResult)) { float[] resultV = vertexMap.get(vertexNodeSelection.get(i)); System.out.println(resultV[0] + " " + resultV[1] + " " + resultV[2]); } else if (edgesMap.containsKey(pickResult)) { System.out.println(edgesMap.get(edgeNodeSelection.get(i)).toString()); - }else if (faceMapMesh.containsKey(pickResult)){ - System.out.println(faceMapMesh.get(faceNodeSelection.get(i)).toString()); + } else if (newFaceMap.containsKey(pickResult)) { + System.out.println(newFaceMap.get(faceNodeSelection.get(i)).getCoordinatesOfPoints(globalVertexList)); } } - System.out.println("All selected nodes: " + vertexNodeSelection.size() + " vertices. " - + edgeNodeSelection.size() + " edges. " + faceNodeSelection.size() + " faces." ); + System.out.println("\nAll selected nodes: " + vertexNodeSelection.size() + " vertices. " + + edgeNodeSelection.size() + " edges. " + faceNodeSelection.size() + " faces."); + } } @@ -1172,4 +1181,8 @@ public void setFlagRenderFaces(boolean rfaces){ renderFaces = rfaces; } + public void setFlagDebugMode(boolean debug){ + debugMode = debug; + } + } diff --git a/src/main/java/edu/gcsc/jfx3d/ugx/hexahedron.ugx b/src/main/java/edu/gcsc/jfx3d/ugx/hexahedron.ugx deleted file mode 100644 index 12a1c3d..0000000 --- a/src/main/java/edu/gcsc/jfx3d/ugx/hexahedron.ugx +++ /dev/null @@ -1,23 +0,0 @@ - - - -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 1 1 1 -1 1 1 - 0 3 3 2 2 1 1 0 1 5 5 4 4 0 2 6 6 5 3 7 7 6 4 7 - 0 3 2 1 0 1 5 4 1 2 6 5 2 3 7 6 3 0 4 7 4 5 6 7 - - - 0 1 2 3 4 5 6 7 - 0 1 2 3 4 5 6 7 8 9 10 11 - 0 1 2 3 4 5 - - - - - - - - 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 - 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 - 0 1 1 1 2 1 3 1 4 1 5 1 - - - diff --git a/src/main/java/edu/gcsc/jfx3d/ugx/lowResSubsetTest.ugx b/src/main/java/edu/gcsc/jfx3d/ugx/lowResSubsetTest.ugx new file mode 100644 index 0000000..d44c30f --- /dev/null +++ b/src/main/java/edu/gcsc/jfx3d/ugx/lowResSubsetTest.ugx @@ -0,0 +1,38 @@ + + + 2 2 -1 4 2 -1 4 4 -1 2 4 -1 2 2 1 4 2 1 4 4 1 2 4 1 -4 -4 -1 -2 -4 -1 -2 -2 -1 -4 -2 -1 -4 -4 1 -2 -4 1 -2 -2 1 -4 -2 1 2 -4 -1 4 -4 -1 4 -2 -1 2 -2 -1 2 -4 1 4 -4 1 4 -2 1 2 -2 1 -4 2 -1 -2 2 -1 -2 4 -1 -4 4 -1 -4 2 1 -2 2 1 -2 4 1 -4 4 1 + 0 3 3 2 2 1 1 0 1 5 5 4 4 0 2 6 6 5 3 7 7 6 4 7 8 11 11 10 10 9 9 8 9 13 13 12 12 8 10 14 14 13 11 15 15 14 12 15 16 19 19 18 18 17 17 16 17 21 21 20 20 16 18 22 22 21 19 23 23 22 20 23 24 27 27 26 26 25 25 24 25 29 29 28 28 24 26 30 30 29 27 31 31 30 28 31 + 0 3 2 1 0 1 5 4 1 2 6 5 2 3 7 6 3 0 4 7 4 5 6 7 8 11 10 9 8 9 13 12 9 10 14 13 10 11 15 14 11 8 12 15 12 13 14 15 16 19 18 17 16 17 21 20 17 18 22 21 18 19 23 22 19 16 20 23 20 21 22 23 24 27 26 25 24 25 29 28 25 26 30 29 26 27 31 30 27 24 28 31 28 29 30 31 + + + 24 25 26 27 28 29 30 31 + 36 37 38 39 40 41 42 43 44 45 46 47 + 18 19 20 21 22 23 + + + 0 1 2 3 4 5 6 7 + 0 1 2 3 4 5 6 7 8 9 10 11 + 0 1 2 3 4 5 + + + 8 9 10 11 12 13 14 15 + 12 13 14 15 16 17 18 19 20 21 22 23 + 6 7 8 9 10 11 + + + 16 17 18 19 20 21 22 23 + 24 25 26 27 28 29 30 31 32 33 34 35 + 12 13 14 15 16 17 + + + + + + + + 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 + 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 + 18 1 19 1 20 1 21 1 22 1 23 1 + + + diff --git a/src/main/java/edu/gcsc/jfx3d/ugx/prism.ugx b/src/main/java/edu/gcsc/jfx3d/ugx/prism.ugx deleted file mode 100644 index 21c3758..0000000 --- a/src/main/java/edu/gcsc/jfx3d/ugx/prism.ugx +++ /dev/null @@ -1,24 +0,0 @@ - - - -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 1 1 1 - 0 2 2 1 1 0 1 4 4 3 3 0 2 5 5 4 3 5 - 0 2 1 3 4 5 - 0 1 4 3 1 2 5 4 2 0 3 5 - 0 1 2 3 4 5 - - - 0 1 2 3 4 5 - 0 1 2 3 4 5 6 7 8 - 0 1 2 3 4 - 0 - - - - - - - - 1 1 - - - diff --git a/src/main/java/edu/gcsc/jfx3d/ugx/pyramid.ugx b/src/main/java/edu/gcsc/jfx3d/ugx/pyramid.ugx deleted file mode 100644 index 7a795dd..0000000 --- a/src/main/java/edu/gcsc/jfx3d/ugx/pyramid.ugx +++ /dev/null @@ -1,24 +0,0 @@ - - - -1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 0 0 1 - 0 3 3 2 2 1 1 0 1 4 4 0 2 4 3 4 - 0 1 4 1 2 4 2 3 4 0 4 3 - 0 3 2 1 - 0 1 2 3 4 - - - 0 1 2 3 4 - 0 1 2 3 4 5 6 7 - 0 1 2 3 4 - 0 - - - - - - - - 1 1 - - - diff --git a/src/main/java/edu/gcsc/jfx3d/ugx/testobject - Kopie.ugx b/src/main/java/edu/gcsc/jfx3d/ugx/testobject - Kopie.ugx deleted file mode 100644 index e0aa111..0000000 --- a/src/main/java/edu/gcsc/jfx3d/ugx/testobject - Kopie.ugx +++ /dev/null @@ -1,24 +0,0 @@ - - - -1 -1 -1 10 -1 -1 10 30 -1 -1 30 -1 -1 -1 10 10 -1 10 10 30 10 -1 30 10 -1 30 10 - 2 3 3 0 0 2 0 1 1 2 5 1 0 5 0 4 4 5 1 6 6 2 5 6 8 3 2 8 6 8 8 0 8 4 4 6 0 6 - 2 3 0 0 1 2 5 1 0 0 4 5 2 1 6 6 1 5 8 3 2 6 8 2 0 3 8 8 4 0 5 4 6 6 4 8 5 0 6 6 0 4 0 2 8 2 0 6 6 0 1 0 6 8 - 5 6 0 4 0 8 2 3 2 6 0 1 0 6 5 1 0 6 2 8 6 8 0 4 - - - 0 1 2 3 4 5 6 7 - 0 1 2 3 4 5 6 7 8 9 10 11 - - - 0 5 4 1 2 3 - - - - - - - - 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 - - - diff --git a/src/main/java/edu/gcsc/jfx3d/ugx/tetrah.ugx b/src/main/java/edu/gcsc/jfx3d/ugx/tetrah.ugx deleted file mode 100644 index 140a604..0000000 --- a/src/main/java/edu/gcsc/jfx3d/ugx/tetrah.ugx +++ /dev/null @@ -1,28 +0,0 @@ - - - 1 1 1 -1 -1 1 -1 1 -1 1 -1 -1 - 0 2 2 1 1 0 2 3 3 1 0 3 - 0 2 1 1 2 3 0 3 2 0 1 3 - 0 1 2 3 - - - - - 0 1 2 3 - 0 1 2 3 4 5 - 0 1 2 3 - 0 - - - - - - - - 0 1 1 1 2 1 3 1 - 0 1 1 1 2 1 3 1 4 1 5 1 - 0 1 1 1 2 1 3 1 - 0 1 - - -