[vtkusers] vtkSmartPointer and derived classes

Sara Siegal ssiegal at passportsystems.com
Thu Apr 14 10:50:24 EDT 2011


Hi,

I derived a class from vtkCommand and would like to be able to instantiate it with a vtkSmartPointer. Something like this:

class myClass : public vtkCommand
{
public:
    static vtkSmartPointer<myClass> New();
etc.
}

Later on:
vtkSmartPointer<myClass> p = vtkSmartPointer<myClass>::New();

The examples in the Examples/Build directory of the vtk source tree all use straight C++ pointers, and the vtkStandardNewMacro, not the new vtkSmartPointer. Is there an equivalent to vtkStandardNewMacro for the new style of smart pointer?

Thank you,
Sara Siegal



More information about the vtkusers mailing list