<P> Hi, Malcolm:
<P> Thank you for your answer.
<P> I tried to use ellipsoids.GetSource() to get the vtkPolyData first. Then I use GetNumberOfCells() to get the number of cells. But I always got 0 as the number.
<P> I also tried to use GetCellType() to verify whether I had gotten the correct vtkPolyData, but it also always was 0.
<P> What's the matter, please?
<P> If I get the right cell set, could you please tell me which method of vtkPolyData should be used to get Point Id from the Cell Id? Thank you again.
<P>
<P>Regards
<P>
<P>Lian
<P> <B><I>Malcolm Drummond <malcolm@geovision.co.za></I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
<DIV><FONT face=Arial size=2>Hi Lian</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>If you use cell-picker you can integer-divide the cell-id by the number of cells in the source (use GetNumberOfCells). You'll then have the id of the point & scalar in Dataset associated with the picked glyph.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Malcolm</FONT> </DIV>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=jl_vtk@yahoo.com href="mailto:jl_vtk@yahoo.com">lian jiang</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@public.kitware.com href="mailto:vtkusers@public.kitware.com">vtkusers@public.kitware.com</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, March 27, 2002 4:35 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] about the picking of vtkTensorGlyph</DIV>
<DIV><BR></DIV>
<P>Hi, all:</P>
<P> For picking a object in a vtkTensorGlyph, I have gotten the non-zero return value with vtkPointPicker and vtkCellPicker. Which picker should I use to figure out which object I have picked? </P>
<P> vtkTensorGlyph seems to be different from Glyph3D, so the methods disscussed before couldn't be used here. How can I export the vtkTensorGlyph to an indexed cell set or point set? How can I associate a cell or a point with some specific object in the vtkTensorGlyph? Thanks a lot!</P>
<P>Below is the code building the vtkTensorGlyph.</P>
<P>vtkUnstructuredGrid Dataset=new vtkUnstructuredGrid();<BR> vtkPoints pointArray=new vtkPoints();<BR> vtkDoubleArray colorArray=new vtkDoubleArray();<BR> vtkDoubleArray tensorArray=new vtkDoubleArray();<BR> vtkSphereSource sphere = new vtkSphereSource();<BR> vtkTensorGlyph ellipsoids=new vtkTensorGlyph();<BR> vtkPolyDataMapper ellipMapper = new vtkPolyDataMapper();<BR> vtkPolyDataNormals ellipNormals=new vtkPolyDataNormals();</P>
<P> vtkActor ellipActor=new vtkActor();<BR> <BR> tensorArray.SetNumberOfComponents(9);</P>
<P> for(i=0; i<numObjects; i++)<BR> {<BR> pointArray.InsertNextPoint(objectArray[i].centroid);<BR> tensorArray.InsertNextTuple9(objectArray[i].tensor[0], objectArray[i].tensor[1], objectArray[i].tensor[2],<BR> objectArray[i].tensor[3], objectArray[i].tensor[4], objectArray[i].tensor[5],<BR> objectArray[i].tensor[6], objectArray[i].tensor[7], objectArray[i].tensor[8]);<BR> }</P>
<P> Dataset.SetPoints(pointArray);<BR> Dataset.GetPointData().SetTensors(tensorArray);</P>
<P> sphere.SetThetaResolution(20);<BR> sphere.SetPhiResolution(20);</P>
<P> ellipsoids.SetInput(Dataset);<BR> ellipsoids.SetSource(sphere.GetOutput());<BR> ellipsoids.ClampScalingOn();</P>
<P> ellipNormals.SetInput(ellipsoids.GetOutput());<BR> ellipMapper.SetInput(ellipNormals.GetOutput());</P>
<P> ellipActor.SetMapper(ellipMapper); // I get ellipsoid actor<BR>////////////////////////////////////////////////////////////////////////////</P>
<P> </P>
<P>BEST REGARDS</P>
<P> </P>
<P>Lian</P>
<P><BR>
<HR SIZE=1>
<B>Do You Yahoo!?</B><BR><A href="http://us.f202.mail.yahoo.com/ym/$rd_url/tag/http://movies.yahoo.com/">Yahoo! Movies</A> - coverage of the 74th Academy Awards®</BLOCKQUOTE></BLOCKQUOTE><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="$rd_url/tag/http://movies.yahoo.com/">Yahoo! Movies</a> - coverage of the 74th Academy Awards®