public void setMeasurementMode(boolean enabled) { measuring = enabled; if (enabled) { if (choosingPivotPoint) { // disable choose-pivot-point mode setChoosePivotPointMode(false); } // initialize PickCanvas for mouse picking if (pickCanvas == null) { pickCanvas = new PickCanvas(this, kainBG); pickCanvas.setMode(PickCanvas.GEOMETRY); } if (snapList == null) { snapList = new LinkedList<Point3d>(); } } else // clear remaining first point and remove the marker if (measurer != null) { try { Mark currentMark = measurer.getMarks().getLast(); if (currentMark.isFristPointPlaced()) { measurer.removeChild(currentMark); currentMark.setFirstPointPlaced(false); } } catch (NoSuchElementException ex) { } measurer.getMarker().removeMarkerLine(); } }
public void setChoosePivotPointMode(boolean enabled) { choosingPivotPoint = enabled; if (enabled) { if (pickCanvas2 == null) { pickCanvas2 = new PickCanvas(this, kainBG); pickCanvas2.setMode(PickCanvas.GEOMETRY); } } else { // remove if (pivotPointAdjustor != null) { kainTG.removeChild(pivotPointAdjustor); pivotPointAdjustor = null; } } }