1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkPV3FoamReader.h,v $
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
14 =========================================================================*/
15 // .NAME vtkPV3FoamReader - reads a dataset in OpenFOAM format
16 // .SECTION Description
17 // vtkPV3FoamReader creates an multiblock dataset.
18 // It uses the OpenFOAM infrastructure (fvMesh, etc) to
19 // handle mesh and field data.
21 #ifndef __vtkPV3FoamReader_h
22 #define __vtkPV3FoamReader_h
24 // Foam forward declarations
31 #include "vtkMultiBlockDataSetAlgorithm.h"
33 // VTK forward declarations
34 class vtkDataArraySelection
;
35 class vtkCallbackCommand
;
38 class VTK_IO_EXPORT vtkPV3FoamReader
40 public vtkMultiBlockDataSetAlgorithm
43 vtkTypeRevisionMacro(vtkPV3FoamReader
,vtkMultiBlockDataSetAlgorithm
);
44 void PrintSelf(ostream
&, vtkIndent
);
46 static vtkPV3FoamReader
* New();
49 // Get the current timestep and the timestep range.
50 vtkGetVector2Macro(TimeStepRange
, int);
53 // Set/Get the filename.
54 vtkSetStringMacro(FileName
);
55 vtkGetStringMacro(FileName
);
59 vtkSetMacro(UpdateGUI
, int);
60 vtkGetMacro(UpdateGUI
, int);
63 // FOAM mesh caching control
64 vtkSetMacro(CacheMesh
, int);
65 vtkGetMacro(CacheMesh
, int);
68 // FOAM extrapolate internal values onto the patches
69 vtkSetMacro(ExtrapolatePatches
, int);
70 vtkGetMacro(ExtrapolatePatches
, int);
72 // FOAM read sets control
73 vtkSetMacro(IncludeSets
, int);
74 vtkGetMacro(IncludeSets
, int);
77 // FOAM read zones control
78 vtkSetMacro(IncludeZones
, int);
79 vtkGetMacro(IncludeZones
, int);
82 // FOAM display patch names control
83 vtkSetMacro(ShowPatchNames
, int);
84 vtkGetMacro(ShowPatchNames
, int);
87 // Get the current timestep
91 // Parts selection list control
92 vtkDataArraySelection
* GetPartSelection();
93 int GetNumberOfPartArrays();
94 int GetPartArrayStatus(const char* name
);
95 void SetPartArrayStatus(const char* name
, int status
);
96 const char* GetPartArrayName(int index
);
99 // volField selection list control
100 vtkDataArraySelection
* GetVolFieldSelection();
101 int GetNumberOfVolFieldArrays();
102 int GetVolFieldArrayStatus(const char* name
);
103 void SetVolFieldArrayStatus(const char* name
, int status
);
104 const char* GetVolFieldArrayName(int index
);
107 // pointField selection list control
108 vtkDataArraySelection
* GetPointFieldSelection();
109 int GetNumberOfPointFieldArrays();
110 int GetPointFieldArrayStatus(const char* name
);
111 void SetPointFieldArrayStatus(const char* name
, int status
);
112 const char* GetPointFieldArrayName(int index
);
115 // lagrangianField selection list control
116 vtkDataArraySelection
* GetLagrangianFieldSelection();
117 int GetNumberOfLagrangianFieldArrays();
118 int GetLagrangianFieldArrayStatus(const char* name
);
119 void SetLagrangianFieldArrayStatus(const char* name
, int status
);
120 const char* GetLagrangianFieldArrayName(int index
);
123 // Callback registered with the SelectionObserver
124 // for all the selection lists
125 static void SelectionModifiedCallback
133 void SelectionModified();
144 //- Return information about mesh, times, etc without loading anything
145 virtual int RequestInformation
148 vtkInformationVector
**,
149 vtkInformationVector
*
152 //- Get the mesh/fields for a particular time
154 virtual int RequestData
157 vtkInformationVector
**,
158 vtkInformationVector
*
161 //- Fill in additional port information
162 virtual int FillOutputPortInformation(int, vtkInformation
*);
164 // The observer to modify this object when array selections are modified
165 vtkCallbackCommand
* SelectionObserver
;
171 //- Disallow default bitwise copy construct
172 vtkPV3FoamReader(const vtkPV3FoamReader
&);
174 //- Disallow default bitwise assignment
175 void operator=(const vtkPV3FoamReader
&);
177 //- Add patch names to the view
178 void addPatchNamesToView();
180 //- Remove patch names from the view
181 void removePatchNamesFromView();
183 int TimeStepRange
[2];
186 int ExtrapolatePatches
;
191 //- Dummy variable/switch for invoke a reader update
194 vtkDataArraySelection
* PartSelection
;
195 vtkDataArraySelection
* VolFieldSelection
;
196 vtkDataArraySelection
* PointFieldSelection
;
197 vtkDataArraySelection
* LagrangianFieldSelection
;
199 //- Cached data for output port0 (experimental!)
200 vtkMultiBlockDataSet
* output0_
;
203 Foam::vtkPV3Foam
* foamData_
;
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 // ************************************************************************* //