public void planeClickedOn(SlicePlane plane) {
SlicePlane overPlane = plane;
SlicePlane mirroredPlane = null;
if (overPlane != null) {
if (this.mirrorSelection)
mirroredPlane = this.getMirrored(overPlane);
if (GLOBAL.uiTools.keyPressed
&& (GLOBAL.uiTools.keyCode == PConstants.CONTROL || GLOBAL.uiTools.keyCode == 157)) {
if (GLOBAL.sketchChairs.getCurChair().selectedPlanes.getList()
.contains(overPlane)) {
GLOBAL.sketchChairs.getCurChair().selectedPlanes.getList()
.remove(overPlane);
} else {
GLOBAL.sketchChairs.getCurChair().selectedPlanes
.add(overPlane);
overPlane.setSelected(true);
}
if (mirroredPlane != null) {
if (GLOBAL.sketchChairs.getCurChair().selectedPlanes
.getList().contains(mirroredPlane)) {
GLOBAL.sketchChairs.getCurChair().selectedPlanes
.getList().remove(mirroredPlane);
} else {
GLOBAL.sketchChairs.getCurChair().selectedPlanes
.add(mirroredPlane);
mirroredPlane.setSelected(true);
}
}
} else {
GLOBAL.sketchChairs.getCurChair().slicePlanesSlatSlices.unselectAll();
GLOBAL.sketchChairs.getCurChair().selectedPlanes.unselectAll();
GLOBAL.sketchChairs.getCurChair().selectedPlanes.empty();
GLOBAL.sketchChairs.getCurChair().selectedPlanes.add(overPlane);
overPlane.setSelected(true);
//GLOBAL.sketchChairs.getCurChair().selectedPlanes
//.add(overPlane);
if (mirroredPlane != null) {
GLOBAL.sketchChairs.getCurChair().selectedPlanes
.add(mirroredPlane);
mirroredPlane.setSelected(true);
}
}
}