initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / postProcessing / graphics / PV3FoamReader / PV3FoamReader / vtkPV3FoamReader.h
blobbc21cd8ce816978129720a4822454c455897780d
1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkPV3FoamReader.h,v $
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
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
25 namespace Foam
27 class vtkPV3Foam;
30 // VTK includes
31 #include "vtkMultiBlockDataSetAlgorithm.h"
33 // VTK forward declarations
34 class vtkDataArraySelection;
35 class vtkCallbackCommand;
38 class VTK_IO_EXPORT vtkPV3FoamReader
40 public vtkMultiBlockDataSetAlgorithm
42 public:
43 vtkTypeRevisionMacro(vtkPV3FoamReader,vtkMultiBlockDataSetAlgorithm);
44 void PrintSelf(ostream&, vtkIndent);
46 static vtkPV3FoamReader* New();
48 // Description:
49 // Get the current timestep and the timestep range.
50 vtkGetVector2Macro(TimeStepRange, int);
52 // Description:
53 // Set/Get the filename.
54 vtkSetStringMacro(FileName);
55 vtkGetStringMacro(FileName);
57 // Description:
58 // GUI update control
59 vtkSetMacro(UpdateGUI, int);
60 vtkGetMacro(UpdateGUI, int);
62 // Description:
63 // FOAM mesh caching control
64 vtkSetMacro(CacheMesh, int);
65 vtkGetMacro(CacheMesh, int);
67 // Description:
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);
76 // Description:
77 // FOAM read zones control
78 vtkSetMacro(IncludeZones, int);
79 vtkGetMacro(IncludeZones, int);
81 // Description:
82 // FOAM display patch names control
83 vtkSetMacro(ShowPatchNames, int);
84 vtkGetMacro(ShowPatchNames, int);
86 // Description:
87 // Get the current timestep
88 int GetTimeStep();
90 // Description:
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);
98 // Description:
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);
106 // Description:
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);
114 // Description:
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);
122 // Description:
123 // Callback registered with the SelectionObserver
124 // for all the selection lists
125 static void SelectionModifiedCallback
127 vtkObject* caller,
128 unsigned long eid,
129 void* clientdata,
130 void* calldata
133 void SelectionModified();
136 protected:
138 //- Construct null
139 vtkPV3FoamReader();
141 //- Destructor
142 ~vtkPV3FoamReader();
144 //- Return information about mesh, times, etc without loading anything
145 virtual int RequestInformation
147 vtkInformation*,
148 vtkInformationVector**,
149 vtkInformationVector*
152 //- Get the mesh/fields for a particular time
153 //- Destructor
154 virtual int RequestData
156 vtkInformation*,
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;
167 char* FileName;
169 private:
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];
184 int CacheMesh;
186 int ExtrapolatePatches;
187 int IncludeSets;
188 int IncludeZones;
189 int ShowPatchNames;
191 //- Dummy variable/switch for invoke a reader update
192 int UpdateGUI;
194 vtkDataArraySelection* PartSelection;
195 vtkDataArraySelection* VolFieldSelection;
196 vtkDataArraySelection* PointFieldSelection;
197 vtkDataArraySelection* LagrangianFieldSelection;
199 //- Cached data for output port0 (experimental!)
200 vtkMultiBlockDataSet* output0_;
202 //BTX
203 Foam::vtkPV3Foam* foamData_;
204 //ETX
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 #endif
211 // ************************************************************************* //