<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='color:#1F497D'>I&#8217;ve noticed the problem when I
pick on a text actor (i.e. the label corresponding to the point). It will give
me a different node and that node&#8217;s corresponding scalar.</span><span
style='color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>William
E Lucarell<br>
<b>Sent:</b> Tuesday, April 08, 2008 11:22 AM<br>
<b>To:</b> 'VTK_question'<br>
<b>Subject:</b> [vtkusers] Problem with vtkPointPicker<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I have a 2D mesh with my vtkPointPicker and sometimes the
point showing up doesn&#8217;t correspond to a point on/near where my mouse is when I
hit &#8220;p&#8221;.&nbsp; Below is my code:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
renWin.addWindowSetObserver(new Observer() {<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;@Override<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;public void update(Observable o, Object arg) {<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;// Create a point picker<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;pickerPoint = new vtkPointPicker();<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;// Now at the end of the pick event call the above
function.<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;pickerPoint.AddObserver(&quot;EndPickEvent&quot;,
MeshCreator.this, &quot;annotatePick&quot;);<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;renWin.getIren().SetPicker(pickerPoint);<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;// Initially pick the cell at this location.<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;pickerPoint.Pick(0, 0, 0, renWin.GetRenderer());<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
&nbsp;&nbsp;}<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
});<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
public void annotatePick() {<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;
if (pickerPoint.GetPointId() &lt; 0) { }<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;
else {<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;pickerInfo.setText(format.format(TestMesh.GetPointData().GetScalars().GetTuple1(pickerPoint.GetPointId())));<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
nodeInfo.setText(Integer.toString(pickerPoint.GetPointId()));<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;
}<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Courier New"'>&nbsp;
}<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I get another node or sometimes a node that doesn&#8217;t even
exist. Is there a bug in the vtkPointPicker?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Thanks!<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><b><i><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#00337F'>Bill Lucarell</span></i></b><span style='font-size:12.0pt;
font-family:"Times New Roman","serif";color:navy'><o:p></o:p></span></p>

</div>

</body>

</html>