[vtkusers] smart pointer as member in class
snakexf at gmail.com
Tue Sep 22 16:13:03 EDT 2015
I tried to define a class, its number is vtkSmartPointer<vtkDoubleArray> data. It is allocated in one member function (init()), and given values in another member function(setdata()). I get always segmentation errors. Il seems that data in setdata() function is not allocated or (freed?). If I put data->SetComponents in init(). All works well. Where is the problem? The pointer?
Thank you very much.
The code is similar like this
data = vtkSmartPointer<vtkDoubleArray>::New();
data->SetNumberOfComponents(1); // size of component in tuple is 1
data->SetNumberOfTuples(Ncell); // size of data
Postdoc in France
More information about the vtkusers