Hi all, <div>I figured out my bug. The result was correct, my expectation false. Variable polydata in main context should not contain normals. </div><div>There is pointer assignement to local pointer copy of polydata inside function </div>
<div><span style>polydata = normalGenerator->GetOutput(); </span></div><div><span style>instead of instance assignement, I looked thorugh it.</span></div><div><span style><br></span></div><div><font color="#222222" face="arial, sans-serif">Have a nice day</font></div>
<div><font color="#222222" face="arial, sans-serif">Jana</font></div><div><br><div class="gmail_quote">On 20 April 2012 19:15, Jana Sefcikova <span dir="ltr"><<a href="mailto:neollie@gmail.com" target="_blank">neollie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bill, <div>thanks for response, but normalGenerator is updated before assignement in original code as you propose.</div>
<div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote">On 20 April 2012 16:34, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Oops...<br>
Try<br>
normalGenerator->Update();<br>
<div> before<br>
polydata = normalGenerator->GetOutput();<br>
<br>
<br>
</div><div><div>On Fri, Apr 20, 2012 at 10:33 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>> wrote:<br>
> Try<br>
> normalGenerator-Update();<br>
> before<br>
> polydata = normalGenerator->GetOutput();<br>
><br>
><br>
> On Fri, Apr 20, 2012 at 10:30 AM, Jana Sefcikova <<a href="mailto:neollie@gmail.com" target="_blank">neollie@gmail.com</a>> wrote:<br>
>> Dear Users,<br>
>> I tested vtk example PolyDataExtractNormals<br>
>> (<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataExtractNormals" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataExtractNormals</a>)<br>
>> code that tries to detect whether normals are present in input polydata<br>
>> structure and if not it will generate them. I made small change to code  at<br>
>> the end of the main function in order to run TestPointNormal twice so I have<br>
>> :<br>
>><br>
>>   std::cout << "PolyData address: " << polydata << std::endl;<br>
>>   TestPointNormals(polydata);<br>
>><br>
>>   TestPointNormals(polydata);<br>
>><br>
>> I expected that after first round the polydata will be changed and will<br>
>> contain new array for "Normals"  because output of normal generator is<br>
>> assigned to input polydata in the first round / polydata =<br>
>> normalGenerator->GetOutput(); /<br>
>> so second  test round should pass directly without normal generation.<br>
>> But after the firt test, polydata normals are not present any more so second<br>
>> Test generate them  again .<br>
>> So my question is : Why normals dissapeared ?<br>
>> The same confusion for me occured when I enabled splitting on normal<br>
>> generator (normalGenerator->SetSplitting(1);).  Inside first<br>
>> TestPointNormals polydata had more points as before at the end (due to<br>
>> splitting), but second test again work on likely unchanged polydata.<br>
>><br>
>> Why two functions working on the same pointer that is changed inside each<br>
>> call looks unchanged ?<br>
>><br>
>> Thanks for any advice.<br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Unpaid intern in BillsBasement at noware dot com<br>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>