Hey,
I’m using cellPicker to pick a point on a brain geometry, like in the example from vtk.js website CellPicker,
As I’m using it on a brain geometry with a lot of triangles, the picking process takes time (2 seconds), I need to change the cursor while the picking is not yet finished, I couldn’t do that using simple css / javascript, and I couldn’t do that using the code below:
grw.getRenderWindow().getInteractor().onRightButtonPress(async (callData) => {
grw.getRenderWindow().getInteractor().getView().setCursor('wait'); // to update the cursor to waiting status
const pos = callData.position;
const point = [pos.x, pos.y, 0.0];
console.log(`Pick at: ${point}`);
picker.pick(point, grw.getRenderer());
const pickedCellId = picker.getCellId();
console.log('Picked cell: ', pickedCellId);
const pickedPoint = picker.getPickedPositions();
const a = pickedPoint[0];
console.log(`Picked: ${pickedPoint}`);
//*******************************************
grw.getRenderWindow().getInteractor().getView().setCursor('pointer'); // to reset the cursor to its normal status
//***************************************
});
grw.getRenderer().resetCamera();
grw.getRenderWindow().render();
});