<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Lian</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I hope I'm not misunderstanding what you're trying 
to do.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>If you insert the&nbsp;</FONT><FONT face=Arial 
size=2>following line&nbsp;at the end of the TenEllip.tcl script you get the 
answer 96 216 20736 ...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>tk_messageBox -message "[[ellipsoids GetSource] 
GetNumberOfCells] [[ellipsoids GetInput] GetNumberOfPoints] [[ellipsoids 
GetOutput] GetNumberOfCells]"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>... so that works. Make sure that you're only 
querying after everything has been set and executed. The glyph filter copies and 
transforms the source dataset for every point in the input dataset - so&nbsp;in 
the case of TenEllip.tcl there will be&nbsp;96*216 = 20736 cells in the output 
dataset. If your cell-picker returns 56, integer division by 96 gives 0 - 
so&nbsp;cell 56 in the output dataset corresponds to point 0 in the input 
dataset. Similarly cell-id 18921 in the output dataset corresponds to point 197 
in the input dataset. Now that you have a point id corresponding to the input 
dataset you can use it to look up and display any&nbsp;values&nbsp;from the 
input datset.   </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Malcolm</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A href="mailto:jl_vtk@yahoo.com" title=jl_vtk@yahoo.com>lian jiang</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  href="mailto:malcolm@geovision.co.za" title=malcolm@geovision.co.za>Malcolm 
  Drummond</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A 
  href="mailto:vtkusers@public.kitware.com" 
  title=vtkusers@public.kitware.com>vtkusers</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, March 28, 2002 8:52 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] about the picking 
  of vtkTensorGlyph</DIV>
  <DIV><BR></DIV>
  <P>Hi, Malcolm: 
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thank you for your answer. 
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I also tried to use 
  GetCellType() to verify whether I had gotten the correct vtkPolyData, but it 
  also always was 0. 
  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; What's the matter,&nbsp; please? 

  <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If I get the right cell 
  set,&nbsp;could&nbsp;you&nbsp;please tell me&nbsp;which method 
  of&nbsp;vtkPolyData should be used to get Point Id from the Cell Id?&nbsp; 
  Thank you again. 
  <P> 
  <P>Regards 
  <P> 
  <P>Lian 
  <P>&nbsp; <B><I>Malcolm Drummond &lt;malcolm@geovision.co.za&gt;</I></B> 
  wrote: 
  <BLOCKQUOTE 
  style="BORDER-LEFT: #1010ff 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px">
    <META content="MSHTML 5.00.2614.3500" name=GENERATOR>
    <STYLE></STYLE>

    <DIV><FONT face=Arial size=2>Hi Lian</FONT></DIV>
    <DIV>&nbsp;</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 &amp; scalar in Dataset associated with 
    the picked glyph.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>Malcolm</FONT>&nbsp;</DIV>
    <BLOCKQUOTE 
    style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
      <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
      <DIV 
      style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
      <A href="mailto:jl_vtk@yahoo.com" title=jl_vtk@yahoo.com>lian jiang</A> 
      </DIV>
      <DIV style="FONT: 10pt arial"><B>To:</B> <A 
      href="mailto:vtkusers@public.kitware.com" 
      title=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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For picking&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkTensorGlyph seems to 
      be different from Glyph3D, so the methods disscussed before couldn't be 
      used here.&nbsp;How can I export the vtkTensorGlyph to an indexed cell set 
      or&nbsp;point set?&nbsp; How can I associate&nbsp;a cell or a point 
      with&nbsp;some specific object in the vtkTensorGlyph? &nbsp;Thanks a 
      lot!</P>
      <P>Below is the code building the vtkTensorGlyph.</P>
      <P>vtkUnstructuredGrid Dataset=new vtkUnstructuredGrid();<BR>&nbsp; 
      vtkPoints&nbsp;&nbsp;&nbsp; pointArray=new vtkPoints();<BR>&nbsp; 
      vtkDoubleArray&nbsp; colorArray=new vtkDoubleArray();<BR>&nbsp; 
      vtkDoubleArray&nbsp; tensorArray=new vtkDoubleArray();<BR>&nbsp; 
      vtkSphereSource sphere = new vtkSphereSource();<BR>&nbsp; vtkTensorGlyph 
      ellipsoids=new vtkTensorGlyph();<BR>&nbsp; vtkPolyDataMapper ellipMapper = 
      new vtkPolyDataMapper();<BR>&nbsp; vtkPolyDataNormals ellipNormals=new 
      vtkPolyDataNormals();</P>
      <P>&nbsp; vtkActor&nbsp;&nbsp;&nbsp; ellipActor=new 
      vtkActor();<BR>&nbsp;&nbsp;<BR>&nbsp; 
      tensorArray.SetNumberOfComponents(9);</P>
      <P>&nbsp; for(i=0; i&lt;numObjects; i++)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; 
      pointArray.InsertNextPoint(objectArray[i].centroid);<BR>&nbsp;&nbsp;&nbsp; 
      tensorArray.InsertNextTuple9(objectArray[i].tensor[0], 
      objectArray[i].tensor[1], 
      objectArray[i].tensor[2],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      objectArray[i].tensor[3], objectArray[i].tensor[4], 
      objectArray[i].tensor[5],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      objectArray[i].tensor[6], objectArray[i].tensor[7], 
      objectArray[i].tensor[8]);<BR>&nbsp; }</P>
      <P>&nbsp; Dataset.SetPoints(pointArray);<BR>&nbsp; 
      Dataset.GetPointData().SetTensors(tensorArray);</P>
      <P>&nbsp; sphere.SetThetaResolution(20);<BR>&nbsp; 
      sphere.SetPhiResolution(20);</P>
      <P>&nbsp; ellipsoids.SetInput(Dataset);<BR>&nbsp; 
      ellipsoids.SetSource(sphere.GetOutput());<BR>&nbsp; 
      ellipsoids.ClampScalingOn();</P>
      <P>&nbsp; ellipNormals.SetInput(ellipsoids.GetOutput());<BR>&nbsp; 
      ellipMapper.SetInput(ellipNormals.GetOutput());</P>
      <P>&nbsp; ellipActor.SetMapper(ellipMapper);&nbsp;&nbsp; // I get 
      ellipsoid 
      actor<BR>////////////////////////////////////////////////////////////////////////////</P>
      <P>&nbsp;</P>
      <P>BEST REGARDS</P>
      <P>&nbsp;</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®</BLOCKQUOTE></BODY></HTML>