initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / utilities / postProcessing / graphics / PV3FoamReader / PV3FoamReader / vtkPV3FoamReader.h
blob8611884b519da42e8186240f73c11a5335d28179
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 #include "vtkMultiBlockDataSetAlgorithm.h"
26 // Foam forward declarations
27 namespace Foam
29 class vtkPV3Foam;
32 // VTK forward declarations
33 class vtkUnstructuredGrid;
34 class vtkPoints;
35 class vtkIntArray;
36 class vtkFloatArray;
37 class vtkDoubleArray;
38 class vtkDataArraySelection;
39 class vtkCallbackCommand;
42 class VTK_IO_EXPORT vtkPV3FoamReader
44 public vtkMultiBlockDataSetAlgorithm
46 public:
48 static vtkPV3FoamReader* New();
50 vtkTypeRevisionMacro
52 vtkPV3FoamReader,
53 vtkMultiBlockDataSetAlgorithm
56 void PrintSelf
58 ostream& os,
59 vtkIndent indent
62 // Description:
63 // Set/Get the filename.
64 vtkSetStringMacro(FileName);
65 vtkGetStringMacro(FileName);
67 // Time control
68 // Set/Get the timestep and the timestep range
69 vtkSetMacro(TimeStep, int);
70 vtkGetMacro(TimeStep, int);
71 vtkSetVector2Macro(TimeStepRange, int);
72 vtkGetVector2Macro(TimeStepRange, int);
74 // GUI update control
75 vtkSetMacro(UpdateGUI, int);
76 vtkGetMacro(UpdateGUI, int);
78 // FOAM mesh caching control
79 vtkSetMacro(CacheMesh, int);
80 vtkGetMacro(CacheMesh, int);
82 // FOAM extrapolate internal values onto the walls
83 vtkSetMacro(ExtrapolateWalls, int);
84 vtkGetMacro(ExtrapolateWalls, int);
86 // FOAM read sets control
87 vtkSetMacro(IncludeSets, int);
88 vtkGetMacro(IncludeSets, int);
90 // FOAM read zones control
91 vtkSetMacro(IncludeZones, int);
92 vtkGetMacro(IncludeZones, int);
94 // FOAM display patch names control
95 vtkSetMacro(ShowPatchNames, int);
96 vtkGetMacro(ShowPatchNames, int);
98 // Region selection list control
99 vtkDataArraySelection* GetRegionSelection();
100 int GetNumberOfRegionArrays();
101 const char* GetRegionArrayName(int index);
102 int GetRegionArrayStatus(const char* name);
103 void SetRegionArrayStatus(const char* name, int status);
105 // volField selection list control
106 vtkDataArraySelection* GetVolFieldSelection();
107 int GetNumberOfVolFieldArrays();
108 const char* GetVolFieldArrayName(int index);
109 int GetVolFieldArrayStatus(const char* name);
110 void SetVolFieldArrayStatus(const char* name, int status);
112 // pointField selection list control
113 vtkDataArraySelection* GetPointFieldSelection();
114 int GetNumberOfPointFieldArrays();
115 int GetPointFieldArrayStatus(const char* name);
116 void SetPointFieldArrayStatus(const char* name, int status);
117 const char* GetPointFieldArrayName(int index);
119 // lagrangianField selection list control
120 vtkDataArraySelection* GetLagrangianFieldSelection();
121 int GetNumberOfLagrangianFieldArrays();
122 int GetLagrangianFieldArrayStatus(const char* name);
123 void SetLagrangianFieldArrayStatus(const char* name, int status);
124 const char* GetLagrangianFieldArrayName(int index);
126 // Callback registered with the SelectionObserver
127 // for all the selection lists
128 static void SelectionModifiedCallback
130 vtkObject* caller,
131 unsigned long eid,
132 void* clientdata,
133 void* calldata
136 void SelectionModified();
139 protected:
141 vtkPV3FoamReader();
142 ~vtkPV3FoamReader();
144 char* FileName;
146 virtual int RequestData
148 vtkInformation*,
149 vtkInformationVector**,
150 vtkInformationVector*
153 virtual int RequestInformation
155 vtkInformation*,
156 vtkInformationVector**,
157 vtkInformationVector*
160 // The observer to modify this object when the array selections
161 // are modified
162 vtkCallbackCommand* SelectionObserver;
165 private:
167 vtkPV3FoamReader(const vtkPV3FoamReader&); // Not implemented.
168 void operator=(const vtkPV3FoamReader&); // Not implemented.
170 //- Add patch names to the view
171 void addPatchNamesToView();
173 //- Remove patch names from the view
174 void removePatchNamesFromView();
176 int TimeStep;
177 int TimeStepRange[2];
179 int CacheMesh;
181 int ExtrapolateWalls;
182 int IncludeSets;
183 int IncludeZones;
184 int ShowPatchNames;
186 int UpdateGUI;
187 int UpdateGUIOld;
189 vtkDataArraySelection* RegionSelection;
190 vtkDataArraySelection* VolFieldSelection;
191 vtkDataArraySelection* PointFieldSelection;
192 vtkDataArraySelection* LagrangianFieldSelection;
194 //- Access to the output port1
195 vtkMultiBlockDataSet* output1_;
197 //BTX
198 Foam::vtkPV3Foam* foamData_;
199 //ETX
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 #endif
206 // ************************************************************************* //