<DIV>Dear All,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I've been trying to label some points with irregular geometery and topology. </DIV>
<DIV>I chose vtkPolyData as it says in the specification that is fine for 0 dimension data.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now I have a problem with labeling the data. </DIV>
<DIV>Could you please have a look at my simplified code and let me know what I'm doing wrong.</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#008000 size=2>
<P>//Points</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2> pointsArray[12] = {1,1,0,1,2,0,2,1,0,2,2,0};</P>
<P>vtkFloatArray *pointFloatArray = vtkFloatArray::New();</P>
<P>pointFloatArray-&gt;SetNumberOfComponents(3);</P>
<P>pointFloatArray-&gt;SetNumberOfTuples(dims[0]*dims[1]*dims[2]); </P>
<P>pointFloatArray-&gt;SetVoidArray(&amp;pointsArray[0],12,1);</P>
<P>vtkPoints *points = vtkPoints::New();</P>
<P>points-&gt;SetData(pointFloatArray);</P>
<P>&nbsp;</P><FONT color=#008000 size=2>
<P>//Vectors</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2> array[12] = {10,5,0,11,6,0,12,7,0,13,8,0};</P>
<P>vtkFloatArray *vectors = vtkFloatArray::New();</P>
<P>vectors-&gt;SetNumberOfComponents(3);</P>
<P>vectors-&gt;SetNumberOfTuples(dims[0]*dims[1]*dims[2]);</P>
<P>vectors-&gt;SetArray(&amp;array[0],12,1);</P>
<P>&nbsp;</P><FONT color=#008000 size=2>
<P>//Poly Data</P></FONT><FONT size=2>
<P>vtkPolyData *polyData = vtkPolyData::New();</P>
<P>polyData-&gt;SetPoints(points);</P>
<P>polyData-&gt;GetPointData()-&gt;SetVectors(vectors);</P>
<P>&nbsp;</P><FONT color=#008000 size=2>
<P>//Label Mapper</P></FONT><FONT size=2>
<P>vtkLabeledDataMapper *labelMapper = vtkLabeledDataMapper::New();</P>
<P>labelMapper-&gt;SetInput(polyData);</P>
<P>labelMapper-&gt;SetLabelModeToLabelVectors();</P>
<P>&nbsp;</P><FONT color=#008000 size=2>
<P>//Actor</P></FONT><FONT size=2>
<P>vtkActor2D *actor = vtkActor2D::New();</P>
<P>actor-&gt;SetMapper(labelMapper);</P>
<P>&nbsp;</P>
<P>The above code works when I'm using vtkStructuredGrid but not for polyData.</P>
<P>(I also tried InsertNextPoint() function for giving the points coordinates to vtkPolyData and that didn't work either)</P>
<P>Many thanks in advance</P></FONT></FONT></FONT></FONT></FONT></DIV><p>
                <hr size=1> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://uk.rd.yahoo.com/mail/taglines/default/messenger/*http://uk.messenger.yahoo.com"><strong><font face="Arial, Helvetica, sans-serif">ALL-NEW 
Yahoo! Messenger</font></strong></a><font face="Arial, Helvetica, sans-serif"><strong> 
- all new features - even more fun!</strong></font><strong><font color="#FF9900"> 
</font></strong></font>