Commit 0c390547 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

STYLE: Added extra documentation on vtkNew use.

Thanks to Bill Lorensen for the suggestions. Also added a See Also
section to point to other related classes.

Change-Id: I7fe75453c882bdbf0acbe4fd33d2c05b4c0fab7f
parent decc9508
......@@ -30,6 +30,22 @@
// vtkSmartPointer<vtkClass> b = a.GetPointer();
// b->SomeOtherMethod();
// \endcode
// It should be noted that vtkNew is not a drop in replacement for
// vtkSmartPointer as it is not implicitly cast to a pointer in functions
// requiring a pointer. The GetPointer() method must be used, for example,
// \code
// vtkNew<vtkRenderer> ren;
// vtkNew<vtkRenderWindow> renWin;
// renWin->AddRenderer(ren.GetPointer());
// vtkNew<vtkRenderWindowInteractor> iren;
// iren->SetRenderWindow(renWin.GetPointer());
// \endcode
// .SECTION See Also
// vtkSmartPointer vtkWeakPointer
#ifndef __vtkNew_h
#define __vtkNew_h
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment