[vtk-developers] vtkNew in examples (or auto?)

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Jun 26 13:06:08 EDT 2017


On Thu, Jun 22, 2017 at 1:01 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
> I prefer vtkSmartPointer because it can be used like any other vtk
> pointer. No need for a GetPointer() is some cases. The example writer
> is free to use vtkSmartPointer or vtkNew. But I would leave them as
> there are.
>
If that is detracting from using vtkNew then I think we should add the
single line to vtkNew. This has bothered me for a while, and I think
it is fair to make vtkNew behave more like the other two pointer
classes. I liked the explicitness of calling Get(), but think it makes
what would otherwise be more convenient a little harder to use.

I will see about putting in a patch for this soon. I really would
rather get rid of the duplication in the examples by preferring vtkNew
or using auto. It is harder to read, and needlessly repeats the class
name in my opinion.


More information about the vtk-developers mailing list