<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>I am always prudent when using VTK, i. e. I never mix the smart pointer and normal pointer of VTK objects.<br><br></div>I have a concern. Suppose we have<br><br></div>vtkPolyData *mesh = some_function_which_returns_vtkPolyData_star(...);<br></div>vtkSmartPointer<vtkPolyData> mesh_ptr = vtkSmartPointer<vtkPolyData>(mesh);<br><br></div>we should do mesh_ptr->Delete() after, right?<br><br></div>However, can we do<br><br></div>vtkSmartPointer<vtkPolyData> mesh_ptr = vtkSmartPointer<vtkPolyData>(some_function_which_returns_vtkPolyData_star(...));<br><br>?<br><br></div>If we do that, how can we delete the reference count to the object before passing it to vtkSmartPointer?<br><br></div>Thanks!<br><br></div>-Mingcheng<br></div>