Commit 566968ca authored by Mark Olesen's avatar Mark Olesen

STYLE: use vtk::Tools directly instead of relying on inheritance

parent 22a67b4d
...@@ -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
...@@ -78,8 +78,6 @@ namespace vtk ...@@ -78,8 +78,6 @@ namespace vtk
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class faMeshAdaptor class faMeshAdaptor
:
protected vtk::Tools
{ {
public: public:
......
...@@ -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) 2017-2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -91,8 +91,6 @@ namespace vtk ...@@ -91,8 +91,6 @@ namespace vtk
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class fvMeshAdaptor class fvMeshAdaptor
:
protected vtk::Tools
{ {
public: public:
......
...@@ -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) 2017-2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -94,7 +94,7 @@ void Foam::vtk::fvMeshAdaptor::convertVolField ...@@ -94,7 +94,7 @@ void Foam::vtk::fvMeshAdaptor::convertVolField
// To improve code reuse, we allocate the CellData as a zeroed-field // To improve code reuse, we allocate the CellData as a zeroed-field
// ahead of time. // ahead of time.
vtkSmartPointer<vtkFloatArray> cdata = zeroField<Type> vtkSmartPointer<vtkFloatArray> cdata = vtk::Tools::zeroField<Type>
( (
fld.name(), fld.name(),
dataset->GetNumberOfPolys() dataset->GetNumberOfPolys()
...@@ -121,7 +121,7 @@ void Foam::vtk::fvMeshAdaptor::convertVolField ...@@ -121,7 +121,7 @@ void Foam::vtk::fvMeshAdaptor::convertVolField
fvPatchField<Type>(p, fld).patchInternalField() fvPatchField<Type>(p, fld).patchInternalField()
); );
transcribeFloatData(cdata, tpptf()); vtk::Tools::transcribeFloatData(cdata, tpptf());
if if
( (
...@@ -138,7 +138,7 @@ void Foam::vtk::fvMeshAdaptor::convertVolField ...@@ -138,7 +138,7 @@ void Foam::vtk::fvMeshAdaptor::convertVolField
} }
else else
{ {
transcribeFloatData(cdata, ptf); vtk::Tools::transcribeFloatData(cdata, ptf);
if if
( (
...@@ -291,7 +291,7 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField ...@@ -291,7 +291,7 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField
{ {
for (const label meshPointi : pointMap) for (const label meshPointi : pointMap)
{ {
foamToVtkTuple(scratch, pfld[meshPointi]); vtk::Tools::foamToVtkTuple(scratch, pfld[meshPointi]);
data->SetTuple(pointi++, scratch); data->SetTuple(pointi++, scratch);
} }
} }
...@@ -299,7 +299,7 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField ...@@ -299,7 +299,7 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField
{ {
for (const Type& val : pfld) for (const Type& val : pfld)
{ {
foamToVtkTuple(scratch, val); vtk::Tools::foamToVtkTuple(scratch, val);
data->SetTuple(pointi++, scratch); data->SetTuple(pointi++, scratch);
} }
} }
...@@ -311,7 +311,7 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField ...@@ -311,7 +311,7 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField
{ {
for (const label meshCelli : addPointCellLabels) for (const label meshCelli : addPointCellLabels)
{ {
foamToVtkTuple(scratch, vfld[meshCelli]); vtk::Tools::foamToVtkTuple(scratch, vfld[meshCelli]);
data->SetTuple(pointi++, scratch); data->SetTuple(pointi++, scratch);
} }
} }
...@@ -319,7 +319,10 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField ...@@ -319,7 +319,10 @@ vtkSmartPointer<vtkFloatArray> Foam::vtk::fvMeshAdaptor::convertPointField
{ {
for (const label meshCelli : addPointCellLabels) for (const label meshCelli : addPointCellLabels)
{ {
foamToVtkTuple(scratch, interpolatePointToCell(pfld, meshCelli)); vtk::Tools::foamToVtkTuple
(
scratch, interpolatePointToCell(pfld, meshCelli)
);
data->SetTuple(pointi++, scratch); data->SetTuple(pointi++, scratch);
} }
} }
...@@ -362,7 +365,7 @@ Foam::vtk::fvMeshAdaptor::convertVolFieldToVTK ...@@ -362,7 +365,7 @@ Foam::vtk::fvMeshAdaptor::convertVolFieldToVTK
vtkIdType celli = 0; vtkIdType celli = 0;
for (const label meshCelli : cellMap) for (const label meshCelli : cellMap)
{ {
foamToVtkTuple(scratch, fld[meshCelli]); vtk::Tools::foamToVtkTuple(scratch, fld[meshCelli]);
data->SetTuple(celli++, scratch); data->SetTuple(celli++, scratch);
} }
......
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