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 #include "vtkMultiBlockDataSetAlgorithm.h"
26 // Foam forward declarations
32 // VTK forward declarations
33 class vtkUnstructuredGrid
;
38 class vtkDataArraySelection
;
39 class vtkCallbackCommand
;
42 class VTK_IO_EXPORT vtkPV3FoamReader
44 public vtkMultiBlockDataSetAlgorithm
48 static vtkPV3FoamReader
* New();
53 vtkMultiBlockDataSetAlgorithm
63 // Set/Get the filename.
64 vtkSetStringMacro(FileName
);
65 vtkGetStringMacro(FileName
);
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);
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
136 void SelectionModified();
146 virtual int RequestData
149 vtkInformationVector
**,
150 vtkInformationVector
*
153 virtual int RequestInformation
156 vtkInformationVector
**,
157 vtkInformationVector
*
160 // The observer to modify this object when the array selections
162 vtkCallbackCommand
* SelectionObserver
;
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();
177 int TimeStepRange
[2];
181 int ExtrapolateWalls
;
189 vtkDataArraySelection
* RegionSelection
;
190 vtkDataArraySelection
* VolFieldSelection
;
191 vtkDataArraySelection
* PointFieldSelection
;
192 vtkDataArraySelection
* LagrangianFieldSelection
;
194 //- Access to the output port1
195 vtkMultiBlockDataSet
* output1_
;
198 Foam::vtkPV3Foam
* foamData_
;
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 // ************************************************************************* //