diff --git a/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C b/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C index 1bd8614b68..3645ddbb0c 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C +++ b/src/functionObjects/graphics/runTimePostProcessing/fieldVisualisationBase.C @@ -100,8 +100,7 @@ void Foam::functionObjects::fieldVisualisationBase::setColourMap lut->SetNumberOfColors(nColours); - vtkSmartPointer ctf = - vtkSmartPointer::New(); + auto ctf = vtkSmartPointer::New(); switch (colourMap_) { @@ -163,8 +162,7 @@ void Foam::functionObjects::fieldVisualisationBase::addScalarBar return; } - vtkSmartPointer sbar = - vtkSmartPointer::New(); + auto sbar = vtkSmartPointer::New(); sbar->SetLookupTable(lut); sbar->SetNumberOfLabels(scalarBar_.numberOfLabels_); @@ -174,8 +172,7 @@ void Foam::functionObjects::fieldVisualisationBase::addScalarBar // - Default scalar bar title text is scales by the scalar bar box // dimensions so if the title is a long string, the text is shrunk to fit // Instead, suppress title and set the title using a vtkTextActor - vtkSmartPointer titleActor = - vtkSmartPointer::New(); + auto titleActor = vtkSmartPointer::New(); sbar->SetTitle(" "); titleActor->SetInput(scalarBar_.title_.c_str()); titleActor->GetTextProperty()->SetFontFamilyToArial(); @@ -282,8 +279,7 @@ void Foam::functionObjects::fieldVisualisationBase::setField case cbField: { // Create look-up table for colours - vtkSmartPointer lut = - vtkSmartPointer::New(); + auto lut = vtkSmartPointer::New(); setColourMap(lut); lut->SetVectorMode(vtkScalarsToColors::MAGNITUDE); @@ -337,9 +333,8 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs vtkRenderer* renderer ) const { - vtkSmartPointer glyph = vtkSmartPointer::New(); - vtkSmartPointer glyphMapper = - vtkSmartPointer::New(); + auto glyph = vtkSmartPointer::New(); + auto glyphMapper = vtkSmartPointer::New(); glyphMapper->SetInputConnection(glyph->GetOutputPort()); glyph->SetInputData(data); @@ -358,8 +353,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs else if (data->GetCellData()->HasArray(scaleFieldNameChar) == 1) { // Need to convert cell data to point data - vtkSmartPointer cellToPoint = - vtkSmartPointer::New(); + auto cellToPoint = vtkSmartPointer::New(); cellToPoint->SetInputData(data); cellToPoint->Update(); vtkDataSet* pds = cellToPoint->GetOutput(); @@ -380,8 +374,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs if (nComponents == 1) { - vtkSmartPointer sphere = - vtkSmartPointer::New(); + auto sphere = vtkSmartPointer::New(); sphere->SetCenter(0, 0, 0); sphere->SetRadius(0.5); @@ -428,8 +421,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs } else if (nComponents == 3) { - vtkSmartPointer arrow = - vtkSmartPointer::New(); + auto arrow = vtkSmartPointer::New(); arrow->SetTipResolution(10); arrow->SetTipRadius(0.1); arrow->SetTipLength(0.35); diff --git a/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C b/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C index 357997df25..f4fe22be99 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C +++ b/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C @@ -120,13 +120,11 @@ addGeometryToScene if (fName.ext() == "vtk") { - vtkSmartPointer points = - vtkSmartPointer::New(); + auto points = vtkSmartPointer::New(); points->SetFileName(fName.c_str()); points->Update(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); actor_->SetMapper(mapper); diff --git a/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C b/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C index b1a9093f63..2d7fc46940 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C +++ b/src/functionObjects/graphics/runTimePostProcessing/functionObjectLine.C @@ -101,13 +101,11 @@ addGeometryToScene if (fName.ext() == "vtk") { - vtkSmartPointer lines = - vtkSmartPointer::New(); + auto lines = vtkSmartPointer::New(); lines->SetFileName(fName.c_str()); lines->Update(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); setField(position, fieldName_, mapper, renderer, lines->GetOutput()); actor_->SetMapper(mapper); diff --git a/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C b/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C index 343985afa2..22b9c7570e 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/functionObjectSurface.C @@ -101,8 +101,7 @@ addGeometryToScene if (representation_ == rtGlyph) { - vtkSmartPointer surf = - vtkSmartPointer::New(); + auto surf = vtkSmartPointer::New(); surf->SetFileName(fName.c_str()); surf->Update(); @@ -121,15 +120,13 @@ addGeometryToScene { if (fName.ext() == "vtk") { - vtkSmartPointer surf = - vtkSmartPointer::New(); + auto surf = vtkSmartPointer::New(); surf->SetFileName(fName.c_str()); surf->Update(); addFeatureEdges(renderer, surf->GetOutput()); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); mapper->SetInputConnection(surf->GetOutputPort()); setField(position, fieldName_, mapper, renderer, surf->GetOutput()); diff --git a/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C b/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C index 19be822aa7..7c68893222 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/geometrySurface.C @@ -79,11 +79,9 @@ void Foam::functionObjects::runTimePostPro::geometrySurface::addGeometryToScene const Field& surfPoints = surf.points(); const Field& surfFaceNormals = surf.faceNormals(); - vtkSmartPointer points = vtkSmartPointer::New(); - vtkSmartPointer triangles = - vtkSmartPointer::New(); - vtkSmartPointer faceNormals = - vtkSmartPointer::New(); + auto points = vtkSmartPointer::New(); + auto triangles = vtkSmartPointer::New(); + auto faceNormals = vtkSmartPointer::New(); faceNormals->SetNumberOfComponents(3); @@ -97,8 +95,7 @@ void Foam::functionObjects::runTimePostPro::geometrySurface::addGeometryToScene { const Foam::face& f = surf[i]; - vtkSmartPointer triangle = - vtkSmartPointer::New(); + auto triangle = vtkSmartPointer::New(); triangle->GetPointIds()->SetId(0, f[0]); triangle->GetPointIds()->SetId(1, f[1]); triangle->GetPointIds()->SetId(2, f[2]); @@ -114,14 +111,12 @@ void Foam::functionObjects::runTimePostPro::geometrySurface::addGeometryToScene surf.clearOut(); - vtkSmartPointer polyData = - vtkSmartPointer::New(); + auto polyData = vtkSmartPointer::New(); polyData->SetPoints(points); polyData->SetPolys(triangles); polyData->GetCellData()->SetNormals(faceNormals); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); mapper->ScalarVisibilityOff(); mapper->SetInputData(polyData); diff --git a/src/functionObjects/graphics/runTimePostProcessing/pathline.C b/src/functionObjects/graphics/runTimePostProcessing/pathline.C index aedd860827..36c1aa9a01 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/pathline.C +++ b/src/functionObjects/graphics/runTimePostProcessing/pathline.C @@ -104,8 +104,7 @@ void Foam::functionObjects::runTimePostPro::pathline::addLines } case rtTube: { - vtkSmartPointer tubes = - vtkSmartPointer::New(); + auto tubes = vtkSmartPointer::New(); tubes->SetInputData(data); tubes->SetRadius(tubeRadius_); tubes->SetNumberOfSides(20); diff --git a/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C b/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C index fe97eba4b3..1a2e917101 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C +++ b/src/functionObjects/graphics/runTimePostProcessing/runTimePostProcessing.C @@ -150,8 +150,7 @@ bool Foam::functionObjects::runTimePostProcessing::write() sigFpe::unset(false); // Initialise render window - vtkSmartPointer renderWindow = - vtkSmartPointer::New(); + auto renderWindow = vtkSmartPointer::New(); renderWindow->OffScreenRenderingOn(); renderWindow->SetSize(output_.width_, output_.height_); renderWindow->SetAAFrames(10); @@ -159,7 +158,7 @@ bool Foam::functionObjects::runTimePostProcessing::write() renderWindow->SetMultiSamples(0); // renderWindow->PolygonSmoothingOn(); - vtkSmartPointer renderer = vtkSmartPointer::New(); + auto renderer = vtkSmartPointer::New(); scene_.initialise(renderer, output_.name_); renderWindow->AddRenderer(renderer); diff --git a/src/functionObjects/graphics/runTimePostProcessing/scene.C b/src/functionObjects/graphics/runTimePostProcessing/scene.C index cd74326a16..d984e9f03b 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/scene.C +++ b/src/functionObjects/graphics/runTimePostProcessing/scene.C @@ -186,20 +186,19 @@ void Foam::functionObjects::runTimePostPro::scene::initialise renderer->SetOcclusionRatio(0); // Set the camera - vtkSmartPointer camera = vtkSmartPointer::New(); + auto camera = vtkSmartPointer::New(); camera->SetParallelProjection(parallelProjection_); renderer->SetActiveCamera(camera); // Add the lights - vtkSmartPointer lightKit = vtkSmartPointer::New(); + auto lightKit = vtkSmartPointer::New(); lightKit->AddLightsToRenderer(renderer); if (!clipBox_.empty()) { const point& min = clipBox_.min(); const point& max = clipBox_.max(); - vtkSmartPointer clipBox = - vtkSmartPointer::New(); + auto clipBox = vtkSmartPointer::New(); clipBox->SetXLength(max.x() - min.x()); clipBox->SetYLength(max.y() - min.y()); clipBox->SetZLength(max.z() - min.z()); @@ -209,8 +208,7 @@ void Foam::functionObjects::runTimePostPro::scene::initialise min.y() + 0.5*(max.y() - min.y()), min.z() + 0.5*(max.z() - min.z()) ); - vtkSmartPointer clipMapper = - vtkSmartPointer::New(); + auto clipMapper = vtkSmartPointer::New(); clipMapper->SetInputConnection(clipBox->GetOutputPort()); clipBoxActor_ = vtkSmartPointer::New(); @@ -401,8 +399,7 @@ void Foam::functionObjects::runTimePostPro::scene::saveImage renderWindow->Render(); // Set up off-screen rendering - vtkSmartPointer windowToImageFilter = - vtkSmartPointer::New(); + auto windowToImageFilter = vtkSmartPointer::New(); windowToImageFilter->SetInput(renderWindow); @@ -414,7 +411,7 @@ void Foam::functionObjects::runTimePostPro::scene::saveImage windowToImageFilter->Update(); // Save the image - vtkSmartPointer writer = vtkSmartPointer::New(); + auto writer = vtkSmartPointer::New(); fileName fName(prefix/outputName_ + '.' + frameIndexStr() + ".png"); writer->SetFileName(fName.c_str()); writer->SetInputConnection(windowToImageFilter->GetOutputPort()); diff --git a/src/functionObjects/graphics/runTimePostProcessing/surface.C b/src/functionObjects/graphics/runTimePostProcessing/surface.C index 5c0383c4ab..222760c456 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/surface.C +++ b/src/functionObjects/graphics/runTimePostProcessing/surface.C @@ -120,8 +120,7 @@ void Foam::functionObjects::runTimePostPro::surface::addFeatureEdges return; } - vtkSmartPointer featureEdges = - vtkSmartPointer::New(); + auto featureEdges = vtkSmartPointer::New(); featureEdges->SetInputData(data); featureEdges->BoundaryEdgesOn(); featureEdges->FeatureEdgesOn(); @@ -131,8 +130,7 @@ void Foam::functionObjects::runTimePostPro::surface::addFeatureEdges featureEdges->ColoringOff(); featureEdges->Update(); - vtkSmartPointer mapper = - vtkSmartPointer::New(); + auto mapper = vtkSmartPointer::New(); mapper->SetInputConnection(featureEdges->GetOutputPort()); mapper->ScalarVisibilityOff(); diff --git a/src/functionObjects/graphics/runTimePostProcessing/text.C b/src/functionObjects/graphics/runTimePostProcessing/text.C index fc395f5717..f83d31118f 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/text.C +++ b/src/functionObjects/graphics/runTimePostProcessing/text.C @@ -81,7 +81,7 @@ void Foam::functionObjects::runTimePostPro::text::addGeometryToScene return; } - vtkSmartPointer actor = vtkSmartPointer::New(); + auto actor = vtkSmartPointer::New(); // Concatenate string with timeStamp if true string textAndTime = string_;