1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 A collection of helper functions when building a reader interface in
34 \*---------------------------------------------------------------------------*/
36 #ifndef vtkPV3Readers_H
37 #define vtkPV3Readers_H
39 // do not include legacy strstream headers
40 #ifndef VTK_EXCLUDE_STRSTREAM_HEADERS
41 # define VTK_EXCLUDE_STRSTREAM_HEADERS
44 #include "className.H"
46 #include "stringList.H"
51 // * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
53 class vtkDataArraySelection;
56 class vtkPV3FoamReader;
59 class vtkMultiBlockDataSet;
61 class vtkUnstructuredGrid;
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 namespace vtkPV3Readers
71 //- Declare name of the class and its debug switch
72 NamespaceName("vtkPV3Readers");
74 //- Bookkeeping for GUI checklists and the multi-block organization
84 partInfo(const char *name, const int blockNo=0)
92 //- Return the block holding these datasets
98 //- Assign block number, return previous value
99 int block(int blockNo)
106 const char* name() const
118 return start_ + size_;
137 //- Assign new start and reset the size
138 void operator=(const int i)
144 //- Increment the size
145 void operator+=(const int n)
152 //- Convenience method use to convert the readers from VTK 5
153 // multiblock API to the current composite data infrastructure
156 vtkMultiBlockDataSet* output,
158 const partInfo& selector,
159 const label datasetNo,
160 const std::string& datasetName
164 //- Convenience method use to convert the readers from VTK 5
165 // multiblock API to the current composite data infrastructure
166 vtkDataSet* GetDataSetFromBlock
168 vtkMultiBlockDataSet* output,
169 const partInfo& selector,
170 const label datasetNo
173 //- Convenience method use to convert the readers from VTK 5
174 // multiblock API to the current composite data infrastructure
175 // ununsed at the moment
176 label GetNumberOfDataSets
178 vtkMultiBlockDataSet* output,
179 const partInfo& selector
183 //- Retrieve the current selections as a wordHashSet
184 wordHashSet getSelected
186 vtkDataArraySelection* select
190 //- Retrieve a sub-list of the current selections
191 wordHashSet getSelected
193 vtkDataArraySelection*,
198 //- Retrieve the current selections
199 stringList getSelectedArrayEntries(vtkDataArraySelection*);
201 //- Retrieve a sub-list of the current selections
202 stringList getSelectedArrayEntries
204 vtkDataArraySelection* select,
205 const partInfo& selector
210 void setSelectedArrayEntries
212 vtkDataArraySelection*,
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 } // End namespace vtkPV3
222 } // End namespace Foam
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 // ************************************************************************* //