Commit c9c088bd authored by Dave Moxey's avatar Dave Moxey

Merge branch 'fix/vtktopng' into 'master'

Fix/vtktopng

The MR makes the pointer management in the VtkToPng utility consistent. Previously some pointers were vtkSmartPointers, while others were not, leading to poor memory management practices.

See merge request !477
parents 64847b28 52ecbdbb
......@@ -69,11 +69,13 @@ int main(int argc, char * argv[])
graphics_factory->SetUseMesaClasses( 1 );
// Create a poly data reader and retrieve dataset from file
vtkXMLUnstructuredGridReader* reader = vtkXMLUnstructuredGridReader::New();
vtkSmartPointer<vtkXMLUnstructuredGridReader> reader =
vtkSmartPointer<vtkXMLUnstructuredGridReader>::New();
reader->SetFileName(vInput.c_str());
reader->Update();
vtkDataSet* data = reader->GetOutputAsDataSet();
vtkSmartPointer<vtkDataSet> data =
vtkSmartPointer<vtkDataSet>(reader->GetOutputAsDataSet());
data->GetPointData()->SetActiveScalars("u");
double scalar_range[2];
......@@ -113,7 +115,7 @@ int main(int argc, char * argv[])
actor->SetMapper(mapper);
// Configure camera position and direction
vtkCamera *camera = vtkCamera::New();
vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New();
camera->SetPosition(0.0,-1.0,1.0);
camera->SetFocalPoint(0,0,0);
......
Markdown is supported
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