FW: [vtkusers] Identifying cells on a plane

R K Shyamprakash ramakrishna.prakash at quest-global.com
Tue Jun 3 03:24:25 EDT 2003


Hello,
       Further to my previous mail, I can get all the edges of the triangle
cell by,
//pick the cell
int cellId = cellPicker.Pick(x,y,0,renderer);
//get picked cell
vtkTriangle pickedCell = myPolyData.GetCell(cellId);
//get the edge cells
vtkTriangle edge1 = pickedCell.GetEdge(0);
vtkTriangle edge2 = pickedCell.GetEdge(1);
vtkTriangle edge3 = pickedCell.GetEdge(2);

Now I compare the normal of each edge cell with the normal of pickedCell. if
they are within my fixed range, I consider the edge cell to lie in the same
plane as pickedCell. I need to assign a different scalar value to all the
cells which lie on the plane like below.

//insert different scalar value
vtkDataArray d = myPolyData.GetCellData().GetScalars();
d.InsertComponent(cellId,0,255);
d.InsertComponent(cellId,0,0);
d.InsertComponent(cellId,0,0);

But the problem here is, I am not able to get the Cell ID of the edge
cells(I am stuck here). Is there any workaround for this or any body knows a
better algorithm for identifying all the cells which lie on a given plane.

Thanks
Shyam


-----Original Message-----
From: vtkusers-admin at public.kitware.com
[mailto:vtkusers-admin at public.kitware.com]On Behalf Of R K Shyamprakash
Sent: Tuesday, June 03, 2003 9:32 AM
To: Vtkusers (E-mail)
Subject: [vtkusers] Identifying cells on a plane


Hi,
      I am trying to identify the cells lying on a plane. Say, I pick a cell
by mouse click. Now is it possible to identify all the cells which are lying
on that plane same as the picked cell? Can some body give me a solution.

Thanks
Shyam

_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list