[vtkusers] How to get the actural cell ID from vtkAreaPicker

Rockydut Rockydut at gmail.com
Wed Dec 17 01:31:53 EST 2014


Hello, everybody.
Who knows how to get the actural cell ID from vtkAreaPicker.
for example:
m_Grid is a vtkUnstructuredGrid variable, which contains many cells like
TETRA, HEXAHEDRON or others.

I add the vtkAreaPicker in the code as left button down, and get the cells
as left button up.
The code in leftbuttondown function is:

//GetInteractor() returns the vtkWin32RenderWindowInteractor pointer.
vtkPlanes* frustum =
static_cast<vtkAreaPicker*>(this->GetInteractor()->GetPicker())->GetFrustum();
VTK_CREATE(vtkExtractGeometry, extractGeometry);
extractGeometry->SetImplicitFunction(frustum);
extractGeometry->SetInputData(m_Grid);
extractGeometry->Update();
vtkUnstructuredGrid* grid = extractGeometry->GetOutput();

Therefore, grid is the selected cells in range of mouse selection area.
However, it cannot get the selected cell ids from "grid".
So, how to get the original cell ids in m_Grid.



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-the-actural-cell-ID-from-vtkAreaPicker-tp5729865.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list