[vtkusers] pick vtkCell that is behind other vtkCells
redmod79
michael.j.redmond at gmail.com
Wed Oct 29 19:32:48 EDT 2014
Hi, I've looked through past posts and saw a related post but no one replied
to it, so I'm making a new one.
My problem is I have a finite element model with shell elements, bar
elements, and nodes. I would like to be able to pick a shell element that
is behind other elements. I've tried vtkCellPicker, but this only returns
the first cell that the ray passes through.
I would like to be able to pick from all cells that the ray passes through
and pick the cell whose center is closest to the ray. Once the cell is
picked, I would like to highlight its edges. This means if it is behind
other cells, I would like to force its edges to be drawn so that the user
can see them instead of them behind hidden due to being behind other cells.
I've made a workaround for both of these, but I assume there's a better way
of doing it. I've created points at the center of all the cells and simply
used a vtkPointPicker, and then determined the corresponding cell. I then
draw a new cell on top of the screen close to the camera to force it in
front of all other cells. This seems like a bad hack and inefficient.
I'm pretty new to VTK. I've searched through many examples and bought the
VTK User's guide, but haven't found anything that can help me with this. If
it's in an example somewhere, I haven't been able to find it, or I simply
didn't recognize its applicability.
Any help would be greatly appreciated. Thanks!
--
View this message in context: http://vtk.1045678.n5.nabble.com/pick-vtkCell-that-is-behind-other-vtkCells-tp5729288.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list