diff --git a/src/paraview-plugins/foamPv/foamPvCore.C b/src/paraview-plugins/foamPv/foamPvCore.C index 97f543823381a1d1e73dc8e18560c59007c96565..fce9a9a8790d1bc7dff563eaddb6ec0ba1dcc76c 100644 --- a/src/paraview-plugins/foamPv/foamPvCore.C +++ b/src/paraview-plugins/foamPv/foamPvCore.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -128,44 +128,44 @@ void Foam::foamPvCore::addToBlock } -Foam::hashedWordList Foam::foamPvCore::getSelected +Foam::wordHashSet Foam::foamPvCore::getSelected ( vtkDataArraySelection* select ) { const int n = select->GetNumberOfArrays(); - DynamicList<word> selected(n); + wordHashSet selected(2*n); for (int i=0; i < n; ++i) { if (select->GetArraySetting(i)) { - selected.append(getFoamName(select->GetArrayName(i))); + selected.set(getFoamName(select->GetArrayName(i))); } } - return hashedWordList(selected, true); + return selected; } -Foam::hashedWordList Foam::foamPvCore::getSelected +Foam::wordHashSet Foam::foamPvCore::getSelected ( vtkDataArraySelection* select, - const arrayRange& selector + const labelRange& selector ) { const int n = select->GetNumberOfArrays(); - DynamicList<word> selected(n); + wordHashSet selected(2*n); for (auto i : selector) { if (select->GetArraySetting(i)) { - selected.append(getFoamName(select->GetArrayName(i))); + selected.set(getFoamName(select->GetArrayName(i))); } } - return hashedWordList(selected, true); + return selected; } diff --git a/src/paraview-plugins/foamPv/foamPvCore.H b/src/paraview-plugins/foamPv/foamPvCore.H index dc1c82ff05f7ac82a192bed6a45832214ef8c81f..faad9ec279df9e41b6beaa1a8d9964d20586063c 100644 --- a/src/paraview-plugins/foamPv/foamPvCore.H +++ b/src/paraview-plugins/foamPv/foamPvCore.H @@ -44,7 +44,6 @@ SourceFiles #include "Hash.H" #include "HashSet.H" #include "Map.H" -#include "hashedWordList.H" #include "labelRange.H" // * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // @@ -250,20 +249,20 @@ public: ); - //- Retrieve the current selections as a hashedWordList, - // while stripping off any prefix or suffix - static hashedWordList getSelected + //- Retrieve the current selections as a wordHashSet, + //- while stripping off any prefix or suffix + static wordHashSet getSelected ( vtkDataArraySelection* select ); - //- Retrieve a sub-list of the current selections as a hashedWordList, - // while stripping off any prefix or suffix - static hashedWordList getSelected + //- Retrieve sub-list of the current selections as a wordHashSet, + //- while stripping off any prefix or suffix + static wordHashSet getSelected ( vtkDataArraySelection* select, - const arrayRange& selector + const labelRange& selector ); diff --git a/src/paraview-plugins/vtkPVFoam/vtkPVFoam.C b/src/paraview-plugins/vtkPVFoam/vtkPVFoam.C index f5caec0e148e9be126154942ca36148df5bd8dff..c5c648c386a0073aed4e4e445f89733f5598c969 100644 --- a/src/paraview-plugins/vtkPVFoam/vtkPVFoam.C +++ b/src/paraview-plugins/vtkPVFoam/vtkPVFoam.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -789,11 +789,10 @@ void Foam::vtkPVFoam::renderPatchNames if (show && volMeshPtr_) { - // get the display patches, strip off any prefix/suffix - hashedWordList selectedPatches = getSelected + // Get the display patches, strip off any prefix/suffix + wordHashSet selectedPatches ( - reader_->GetPartSelection(), - rangePatches_ + getSelected(reader_->GetPartSelection(), rangePatches_) ); if (selectedPatches.empty()) diff --git a/src/paraview-plugins/vtkPVFoam/vtkPVFoamFields.C b/src/paraview-plugins/vtkPVFoam/vtkPVFoamFields.C index 238953c18d73eb4f386e2e1056ad517c421bc5c8..348e0625d9cd15a9df59c6b45180b40245e165ff 100644 --- a/src/paraview-plugins/vtkPVFoam/vtkPVFoamFields.C +++ b/src/paraview-plugins/vtkPVFoam/vtkPVFoamFields.C @@ -49,9 +49,12 @@ void Foam::vtkPVFoam::convertVolFields() const fvMesh& mesh = *volMeshPtr_; const bool interpFields = reader_->GetInterpolateVolFields(); - hashedWordList selectedFields = getSelected + wordHashSet selectedFields ( - reader_->GetVolFieldSelection() + getSelected + ( + reader_->GetVolFieldSelection() + ) ); if (selectedFields.empty()) @@ -124,9 +127,12 @@ void Foam::vtkPVFoam::convertPointFields() { const fvMesh& mesh = *volMeshPtr_; - hashedWordList selectedFields = getSelected + wordHashSet selectedFields ( - reader_->GetPointFieldSelection() + getSelected + ( + reader_->GetPointFieldSelection() + ) ); if (selectedFields.empty()) @@ -184,7 +190,10 @@ void Foam::vtkPVFoam::convertAreaFields() vtkDataArraySelection* select = reader_->GetVolFieldSelection(); - hashedWordList selectedFields = getSelected(select); + wordHashSet selectedFields + ( + getSelected(select) + ); if (selectedFields.empty()) { @@ -233,9 +242,12 @@ void Foam::vtkPVFoam::convertLagrangianFields() const fvMesh& mesh = *volMeshPtr_; - hashedWordList selectedFields = getSelected + wordHashSet selectedFields ( - reader_->GetLagrangianFieldSelection() + getSelected + ( + reader_->GetLagrangianFieldSelection() + ) ); if (selectedFields.empty())