mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use auto with vtkSmartPointer
This commit is contained in:
@ -100,8 +100,7 @@ void Foam::functionObjects::fieldVisualisationBase::setColourMap
|
||||
|
||||
lut->SetNumberOfColors(nColours);
|
||||
|
||||
vtkSmartPointer<vtkColorTransferFunction> ctf =
|
||||
vtkSmartPointer<vtkColorTransferFunction>::New();
|
||||
auto ctf = vtkSmartPointer<vtkColorTransferFunction>::New();
|
||||
|
||||
switch (colourMap_)
|
||||
{
|
||||
@ -163,8 +162,7 @@ void Foam::functionObjects::fieldVisualisationBase::addScalarBar
|
||||
return;
|
||||
}
|
||||
|
||||
vtkSmartPointer<vtkScalarBarActor> sbar =
|
||||
vtkSmartPointer<vtkScalarBarActor>::New();
|
||||
auto sbar = vtkSmartPointer<vtkScalarBarActor>::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<vtkTextActor> titleActor =
|
||||
vtkSmartPointer<vtkTextActor>::New();
|
||||
auto titleActor = vtkSmartPointer<vtkTextActor>::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<vtkLookupTable> lut =
|
||||
vtkSmartPointer<vtkLookupTable>::New();
|
||||
auto lut = vtkSmartPointer<vtkLookupTable>::New();
|
||||
setColourMap(lut);
|
||||
lut->SetVectorMode(vtkScalarsToColors::MAGNITUDE);
|
||||
|
||||
@ -337,9 +333,8 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs
|
||||
vtkRenderer* renderer
|
||||
) const
|
||||
{
|
||||
vtkSmartPointer<vtkGlyph3D> glyph = vtkSmartPointer<vtkGlyph3D>::New();
|
||||
vtkSmartPointer<vtkPolyDataMapper> glyphMapper =
|
||||
vtkSmartPointer<vtkPolyDataMapper>::New();
|
||||
auto glyph = vtkSmartPointer<vtkGlyph3D>::New();
|
||||
auto glyphMapper = vtkSmartPointer<vtkPolyDataMapper>::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<vtkCellDataToPointData> cellToPoint =
|
||||
vtkSmartPointer<vtkCellDataToPointData>::New();
|
||||
auto cellToPoint = vtkSmartPointer<vtkCellDataToPointData>::New();
|
||||
cellToPoint->SetInputData(data);
|
||||
cellToPoint->Update();
|
||||
vtkDataSet* pds = cellToPoint->GetOutput();
|
||||
@ -380,8 +374,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs
|
||||
|
||||
if (nComponents == 1)
|
||||
{
|
||||
vtkSmartPointer<vtkSphereSource> sphere =
|
||||
vtkSmartPointer<vtkSphereSource>::New();
|
||||
auto sphere = vtkSmartPointer<vtkSphereSource>::New();
|
||||
sphere->SetCenter(0, 0, 0);
|
||||
sphere->SetRadius(0.5);
|
||||
|
||||
@ -428,8 +421,7 @@ void Foam::functionObjects::fieldVisualisationBase::addGlyphs
|
||||
}
|
||||
else if (nComponents == 3)
|
||||
{
|
||||
vtkSmartPointer<vtkArrowSource> arrow =
|
||||
vtkSmartPointer<vtkArrowSource>::New();
|
||||
auto arrow = vtkSmartPointer<vtkArrowSource>::New();
|
||||
arrow->SetTipResolution(10);
|
||||
arrow->SetTipRadius(0.1);
|
||||
arrow->SetTipLength(0.35);
|
||||
|
||||
Reference in New Issue
Block a user