/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2017-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "vtkPVFoam.H" #include "vtkPVFoamReader.h" // OpenFOAM includes #include "areaFaMesh.H" #include "faMesh.H" #include "fvMesh.H" #include "foamVersion.H" #include "Time.H" #include "patchZones.H" #include "IOobjectList.H" #include "collatedFileOperation.H" // VTK includes #include "vtkDataArraySelection.h" #include "vtkMultiBlockDataSet.h" #include "vtkRenderer.h" #include "vtkTextActor.h" #include "vtkTextProperty.h" #include "vtkSmartPointer.h" #include "vtkInformation.h" // Templates (only needed here) #include "vtkPVFoamUpdateTemplates.C" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(vtkPVFoam, 0); // file-scope static word updateStateName(polyMesh::readUpdateState state) { switch (state) { case polyMesh::UNCHANGED: return "UNCHANGED"; case polyMesh::POINTS_MOVED: return "POINTS_MOVED"; case polyMesh::TOPO_CHANGE: return "TOPO_CHANGE"; case polyMesh::TOPO_PATCH_CHANGE: return "TOPO_PATCH_CHANGE"; }; return "UNKNOWN"; } } // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // namespace Foam { // file-scope //- Create a text actor vtkSmartPointer createTextActor ( const std::string& s, const Foam::point& pt ) { vtkSmartPointer txt = vtkSmartPointer::New(); txt->SetInput(s.c_str()); // Set text properties vtkTextProperty* tprop = txt->GetTextProperty(); tprop->SetFontFamilyToArial(); tprop->BoldOn(); tprop->ShadowOff(); tprop->SetLineSpacing(1.0); tprop->SetFontSize(14); tprop->SetColor(1.0, 0.0, 1.0); tprop->SetJustificationToCentered(); txt->GetPositionCoordinate()->SetCoordinateSystemToWorld(); txt->GetPositionCoordinate()->SetValue(pt.x(), pt.y(), pt.z()); return txt; } } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::vtkPVFoam::resetCounters() { // Reset array range information (ids and sizes) rangeVolume_.reset(); rangePatches_.reset(); rangeClouds_.reset(); rangeCellZones_.reset(); rangeFaceZones_.reset(); rangePointZones_.reset(); rangeCellSets_.reset(); rangeFaceSets_.reset(); rangePointSets_.reset(); } template bool Foam::vtkPVFoam::addOutputBlock ( vtkMultiBlockDataSet* output, const HashTable& cache, const arrayRange& selector, const bool singleDataset ) const { const auto blockNo = output->GetNumberOfBlocks(); vtkSmartPointer block; int datasetNo = 0; const List