<!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> </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> </DIV>
<DIV><FONT face=Arial size=2>If you insert the </FONT><FONT face=Arial
size=2>following line at the end of the TenEllip.tcl script you get the
answer 96 216 20736 ...</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>tk_messageBox -message "[[ellipsoids GetSource]
GetNumberOfCells] [[ellipsoids GetInput] GetNumberOfPoints] [[ellipsoids
GetOutput] GetNumberOfCells]"</FONT></DIV>
<DIV> </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 in
the case of TenEllip.tcl there will be 96*216 = 20736 cells in the output
dataset. If your cell-picker returns 56, integer division by 96 gives 0 -
so 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 values from the
input datset. </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Malcolm</FONT></DIV>
<DIV> </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> 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="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> </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="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> 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®</BLOCKQUOTE></BODY></HTML>