@Override
 public void viewerChanged(ViewerEvent event) {
   if (event.getType() == ViewerEvent.ViewerEventType.POSITION_CHANGED) {
     cursorPos.z = canvas.getPositionZ();
     painterChanged();
   }
 }
 @Override
 public void viewerChanged(ViewerEvent event) {
   if (event.getType() == ViewerEvent.ViewerEventType.POSITION_CHANGED
       && paintMode == PaintMode.line) {
     cancelCompute = true;
     while (computing)
       try {
         Thread.sleep(1);
       } catch (InterruptedException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
       }
     (new Thread(new computeRunnable())).start();
   }
 }