[vtkusers] Initialising arrays of pointers to vtkPolyData, etc.
Marcus Thamson
markie_thomson at yahoo.de
Mon Dec 7 08:55:42 EST 2009
Dear David,
Many thanks! - that seems to work fine with the vtkSmartPointer's and the vtkstd::vector.
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.
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.
for (is=0; is<Ns;is++) {
...
vtkSmartPointer<vtkPolyData> surf = vtkSmartPointer<vtkPolyData>::New();
...
}
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.
Many thanks,
MT
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091207/d43b2c3c/attachment.htm>
More information about the vtkusers
mailing list