Skip to content

Commit

Permalink
Face interaction - Issue #3
Browse files Browse the repository at this point in the history
+ Changed the mouse button for selecting nodes from left mouse button to right mouse button, to avoid 
    selecting nodes while rotating the object

+ Added face interaction
  -> You can select and highlight single faces by rightclicking them. Hold down control to add multiple nodes to 
       the selection

+ Added experimental volume interaction
  -> When clicking a face that is part of a volume, you will select all the faces in that subset (will be changed later)

+ Cycling through the subsets now also works with the plus and minus button, instead of only the numpad add/subtract
  • Loading branch information
esontak committed Feb 25, 2015
1 parent f9ad9c3 commit bd3cc1a
Show file tree
Hide file tree
Showing 11 changed files with 5,043 additions and 25 deletions.
Binary file modified .gradle/2.0/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified .gradle/2.0/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/2.0/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/2.0/taskArtifacts/outputFileStates.bin
Binary file not shown.
Binary file modified .gradle/2.0/taskArtifacts/taskArtifacts.bin
Binary file not shown.
2 changes: 2 additions & 0 deletions src/main/java/edu/gcsc/jfx3d/Geometry2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
public abstract class Geometry2D {

private int[] nodes;
private int index;

public abstract int[] getNodes();
public abstract void setNodes(int[] array);
public abstract int[] getFacesArray();
public abstract int getIndex();



Expand Down
15 changes: 7 additions & 8 deletions src/main/java/edu/gcsc/jfx3d/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,14 @@ public Group createContent() {

String filePath = "../VRL-JFXVis/src/main/java/edu/gcsc/jfx3d/ugx/bigSpineBigAppBot.ugx";
UGXReader ugxr = new UGXReader(filePath);
ugxGeometry = ugxr.xbuildUGX(false, false);
ugxGeometry = ugxr.xbuildUGX(true, true);
subsetNameArray = ugxr.getSubssetNameArray();

root.getChildren().add(ugxGeometry);

VFX3DUtil.addMouseBehavior(ugxGeometry, ugxGeometry, MouseButton.PRIMARY,
Rotate.X_AXIS, Rotate.Y_AXIS);
VFX3DUtil.addMouseBehavior(ugxGeometry, ugxGeometry, MouseButton.SECONDARY,
Rotate.X_AXIS, Rotate.Z_AXIS);


ugxSubsetCount = ugxr.getNumberOfSubsets();

Expand Down Expand Up @@ -247,25 +246,25 @@ private void handleKeyboard(Scene scene,PerspectiveCamera camera){
camera.setTranslateZ(0);

}
if(keycode == KeyCode.ADD){
if(keycode == KeyCode.ADD || keycode == KeyCode.PLUS){

ugxSwitchCounter = (ugxSwitchCounter +1) % ugxSubsetCount;
for (int i = 0; i < ugxSubsetCount; i++) {
if (i == ugxSwitchCounter) {
ugxGeometry.getChildren().get(i).setOpacity(1);
ugxGeometry.getChildren().get(i).setVisible(true);
System.out.println("Currently shown subset: " + ugxSwitchCounter +" of "+ (ugxSubsetCount-1) + ", " + subsetNameArray[ugxSwitchCounter]);
}
else{
ugxGeometry.getChildren().get(i).setOpacity(0);
ugxGeometry.getChildren().get(i).setVisible(false);
}
}

}

if (keycode == KeyCode.SUBTRACT) {
if (keycode == KeyCode.SUBTRACT || keycode == KeyCode.MINUS) {
ugxSwitchCounter = -1;
for (int i = 0; i < ugxSubsetCount; i++) {
ugxGeometry.getChildren().get(i).setOpacity(1);
ugxGeometry.getChildren().get(i).setVisible(true);
}
System.out.println("Currently shown subset: All");
}
Expand Down
208 changes: 192 additions & 16 deletions src/main/java/edu/gcsc/jfx3d/UGXReader.java

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/main/java/edu/gcsc/jfx3d/UGXfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public void convertReaderStringToData(){
// System.out.println(pp3);
// System.out.println("--------------");

quadrilaterals.add(new Quadrilateral(pp0, pp1, pp2, pp3, geometryCounter2D++));
quadrilaterals.add(new Quadrilateral(pp0, pp1, pp2, pp3, geometryCounter2D+=2));
}
containsQuadrilaterals = true;
}
Expand Down Expand Up @@ -486,6 +486,9 @@ public boolean containsPyramids() {
return containsPyramids;
}

public int getGeometryCounter2D(){
return geometryCounter2D;
}



Expand Down
17 changes: 17 additions & 0 deletions src/main/java/edu/gcsc/jfx3d/ugx/neocortex2-small-one-sub.ugx

Large diffs are not rendered by default.

4,821 changes: 4,821 additions & 0 deletions src/main/java/edu/gcsc/jfx3d/ugx/neocortex2-small.ugx

Large diffs are not rendered by default.

0 comments on commit bd3cc1a

Please sign in to comment.