Skip to content
Snippets Groups Projects
Commit 5aefa252 authored by Mickael PHILIT's avatar Mickael PHILIT
Browse files

use vtkNew

parent aefa3a55
No related branches found
No related tags found
Loading
Pipeline #441323 waiting for manual action
......@@ -34,7 +34,7 @@
int TestSetCellsPolyhedronBackCompatibility(int argc, char* argv[])
{
// create the a cube
vtkSmartPointer<vtkPoints> cubeLikePts = vtkSmartPointer<vtkPoints>::New();
vtkNew<vtkPoints> cubeLikePts;
cubeLikePts->InsertNextPoint(0., 10., 0.);
cubeLikePts->InsertNextPoint(10., 10., 0.);
cubeLikePts->InsertNextPoint(10., -10., 0.);
......@@ -47,14 +47,14 @@ int TestSetCellsPolyhedronBackCompatibility(int argc, char* argv[])
// create a test polyhedron
vtkIdType pointIds[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
vtkSmartPointer<vtkUnsignedCharArray> cellTypes = vtkSmartPointer<vtkUnsignedCharArray>::New();
vtkNew<vtkUnsignedCharArray> cellTypes;
cellTypes->InsertNextValue(VTK_POLYHEDRON);
vtkSmartPointer<vtkCellArray> cells = vtkSmartPointer<vtkCellArray>::New();
vtkNew<vtkCellArray> cells;
cells->InsertNextCell(8, pointIds);
vtkSmartPointer<vtkIdTypeArray> faces = vtkSmartPointer<vtkIdTypeArray>::New();
vtkSmartPointer<vtkIdTypeArray> faceLocations = vtkSmartPointer<vtkIdTypeArray>::New();
vtkNew<vtkIdTypeArray> faces;
vtkNew<vtkIdTypeArray> faceLocations;
faceLocations->InsertNextValue(1);
// First value will be ignored
faces->InsertNextValue(-1);
......@@ -138,14 +138,14 @@ int TestSetCellsPolyhedronBackCompatibility(int argc, char* argv[])
}
// create actors
vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();
vtkNew<vtkDataSetMapper> mapper;
mapper->SetInputData(ugrid0);
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
// Create rendering infrastructure
vtkSmartPointer<vtkProperty> prop = vtkSmartPointer<vtkProperty>::New();
vtkNew<vtkProperty> prop;
prop->LightingOff();
prop->SetRepresentationToSurface();
prop->EdgeVisibilityOn();
......@@ -155,16 +155,15 @@ int TestSetCellsPolyhedronBackCompatibility(int argc, char* argv[])
// set property
actor->SetProperty(prop);
vtkSmartPointer<vtkRenderer> ren = vtkSmartPointer<vtkRenderer>::New();
vtkNew<vtkRenderer> ren;
ren->AddActor(actor);
ren->SetBackground(.5, .5, .5);
vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow>::New();
vtkNew<vtkRenderWindow> renWin;
renWin->SetMultiSamples(0);
renWin->AddRenderer(ren);
vtkSmartPointer<vtkRenderWindowInteractor> iren =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin);
iren->Initialize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment