One way to create a VTK object is
vtkObject* MyObject = vtkObject::New();
This method, however, can (and likely will) lead to memory management issues at some point or another. You must manually delete the object
or you will have a memory leak. VTK's solution to this ever-annoying problem is the smart pointer. To use it, you must
Then you can create an object as follows:
vtkSmartPointer<vtkObject> MyObject = vtkSmartPointer<vtkObject>::New();
The idea behind smart pointers is reference counting. If the object goes out of scope and it is not being used anywhere else, it will be deleted automatically. Pretty 'smart', eh?!