Commit de0f98f4 authored by Mark Olesen's avatar Mark Olesen

STYLE: use vtk::Tools::Vertices() method

parent 478eeaed
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -46,33 +46,6 @@ namespace vtk ...@@ -46,33 +46,6 @@ namespace vtk
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
vtkSmartPointer<vtkPolyData>
Foam::vtk::cloudAdaptor::startLagrangian
(
const pointField& points
)
{
auto vtkmesh = vtkSmartPointer<vtkPolyData>::New();
auto vtkpoints = vtkSmartPointer<vtkPoints>::New();
vtkpoints->SetNumberOfPoints(points.size());
vtkIdType particleId = 0;
for (const vector& p : points)
{
vtkpoints->SetPoint(particleId, p.v_);
++particleId;
}
vtkmesh->SetPoints(vtkpoints);
vtkmesh->SetVerts(vtk::Tools::identityVertices(points.size()));
return vtkmesh;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class UnaryMatchPredicate> template<class UnaryMatchPredicate>
...@@ -124,7 +97,7 @@ Foam::vtk::cloudAdaptor::getCloudImpl ...@@ -124,7 +97,7 @@ Foam::vtk::cloudAdaptor::getCloudImpl
vtkSmartPointer<vtkPolyData> vtkmesh; vtkSmartPointer<vtkPolyData> vtkmesh;
if (pointsPtr) if (pointsPtr)
{ {
vtkmesh = startLagrangian(*pointsPtr); vtkmesh = vtk::Tools::Vertices(*pointsPtr);
// Prevent any possible conversion of positions as a field // Prevent any possible conversion of positions as a field
obrTmp.filterKeys obrTmp.filterKeys
......
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