<br><div class="gmail_quote">On Mon, Dec 7, 2009 at 8:55 AM, Marcus Thamson <span dir="ltr"><<a href="mailto:markie_thomson@yahoo.de">markie_thomson@yahoo.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
Dear David,<br><br>Many thanks! - that seems to work fine with the vtkSmartPointer's and the vtkstd::vector.<br><br>As an amateur C programmer (who incrementally learns C++ only on a need-to basis), I found the example code (from your link) quite freaky to begin with.<br>
I am now using vtkSmartPointer to make arrays of all the intermediate surface objects (vtkDoubleArray, vtkPolyData, vtkPoints, vtkCellArray, vtkPolyDataMapper,vtkActor) - I hadn't seen code before where one uses the same variable name in a loop over and over, e.g. <br>
<br> for (is=0; is<Ns;is++) {<br>...<br> vtkSmartPointer<vtkPolyData> surf = vtkSmartPointer<vtkPolyData>::New();<br>...<br>}<br><br>I guess those pointers really are "smart". After searching around, it appears that vtkSmartPointer's do not even need to be Delete'd at the end of the
code.<br><br>Many thanks,<br><font color="#888888">MT<br></font><div class="hm"><br><br></div></td></tr></tbody></table></blockquote><div><br>I'm glad it helped. We're working on a smart pointer tutorial:<br>
<a href="http://www.vtk.org/Wiki/Smart_Pointers">http://www.vtk.org/Wiki/Smart_Pointers</a><br>
<br>it is certainly not polished/finished, but it may help you get started.<br><br clear="all">Thanks,<br><br>David <br></div></div>