2013-12-11 09:25:19 +00:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: Visualization Toolkit
|
2018-02-20 15:48:10 +00:00
|
|
|
Module: $RCSfile: vtkPVFoamReader.h,v $
|
2013-12-11 09:25:19 +00:00
|
|
|
|
|
|
|
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
|
|
|
|
All rights reserved.
|
|
|
|
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notice for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
2018-02-20 15:48:10 +00:00
|
|
|
// .NAME vtkPVFoamReader - reads a dataset in OpenFOAM format
|
2013-12-11 09:25:19 +00:00
|
|
|
// .SECTION Description
|
2018-02-20 15:48:10 +00:00
|
|
|
// vtkPVFoamReader creates an multiblock dataset.
|
2013-12-11 09:25:19 +00:00
|
|
|
// It uses the OpenFOAM infrastructure (fvMesh, etc) to
|
|
|
|
// handle mesh and field data.
|
|
|
|
|
2018-02-20 15:48:10 +00:00
|
|
|
#ifndef __vtkPVFoamReader_h
|
|
|
|
#define __vtkPVFoamReader_h
|
2013-12-11 09:25:19 +00:00
|
|
|
|
|
|
|
// Foam forward declarations
|
|
|
|
namespace Foam
|
|
|
|
{
|
2018-02-20 15:48:10 +00:00
|
|
|
class vtkPVFoam;
|
2013-12-11 09:25:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// VTK includes
|
|
|
|
#include "vtkMultiBlockDataSetAlgorithm.h"
|
|
|
|
|
|
|
|
// VTK forward declarations
|
|
|
|
class vtkDataArraySelection;
|
|
|
|
class vtkCallbackCommand;
|
|
|
|
|
|
|
|
|
2016-11-22 21:54:30 +00:00
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*\
|
2018-02-20 15:48:10 +00:00
|
|
|
Class vtkPVFoamReader Declaration
|
2016-11-22 21:54:30 +00:00
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
|
2018-02-20 15:48:10 +00:00
|
|
|
class vtkPVFoamReader
|
2013-12-11 09:25:19 +00:00
|
|
|
:
|
|
|
|
public vtkMultiBlockDataSetAlgorithm
|
|
|
|
{
|
|
|
|
public:
|
2018-02-20 15:48:10 +00:00
|
|
|
vtkTypeMacro(vtkPVFoamReader, vtkMultiBlockDataSetAlgorithm);
|
2013-12-11 09:25:19 +00:00
|
|
|
void PrintSelf(ostream&, vtkIndent);
|
|
|
|
|
2018-02-20 15:48:10 +00:00
|
|
|
static vtkPVFoamReader* New();
|
2013-12-11 09:25:19 +00:00
|
|
|
|
|
|
|
// Description:
|
|
|
|
// Get the current timestep and the timestep range.
|
|
|
|
vtkGetVector2Macro(TimeStepRange, int);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// Set/Get the filename.
|
|
|
|
vtkSetStringMacro(FileName);
|
|
|
|
vtkGetStringMacro(FileName);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// GUI update control
|
|
|
|
vtkSetMacro(UpdateGUI, int);
|
|
|
|
vtkGetMacro(UpdateGUI, int);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// FOAM mesh caching control
|
|
|
|
vtkSetMacro(CacheMesh, int);
|
|
|
|
vtkGetMacro(CacheMesh, int);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// FOAM extrapolate internal values onto the patches
|
|
|
|
vtkSetMacro(ExtrapolatePatches, int);
|
|
|
|
vtkGetMacro(ExtrapolatePatches, int);
|
|
|
|
|
2018-02-20 15:48:10 +00:00
|
|
|
// Description:
|
|
|
|
// FOAM use vtkPolyhedron instead of decomposing polyhedra
|
|
|
|
vtkSetMacro(UseVTKPolyhedron, int);
|
|
|
|
vtkGetMacro(UseVTKPolyhedron, int);
|
|
|
|
|
2013-12-11 09:25:19 +00:00
|
|
|
// FOAM read sets control
|
|
|
|
vtkSetMacro(IncludeSets, int);
|
|
|
|
vtkGetMacro(IncludeSets, int);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// FOAM read zones control
|
|
|
|
vtkSetMacro(IncludeZones, int);
|
|
|
|
vtkGetMacro(IncludeZones, int);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// FOAM display patch names control
|
|
|
|
vtkSetMacro(ShowPatchNames, int);
|
|
|
|
vtkGetMacro(ShowPatchNames, int);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// Get the current timestep
|
|
|
|
int GetTimeStep();
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// Parts selection list control
|
|
|
|
vtkDataArraySelection* GetPartSelection();
|
|
|
|
int GetNumberOfPartArrays();
|
|
|
|
int GetPartArrayStatus(const char* name);
|
|
|
|
void SetPartArrayStatus(const char* name, int status);
|
|
|
|
const char* GetPartArrayName(int index);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// volField selection list control
|
|
|
|
vtkDataArraySelection* GetVolFieldSelection();
|
|
|
|
int GetNumberOfVolFieldArrays();
|
|
|
|
int GetVolFieldArrayStatus(const char* name);
|
|
|
|
void SetVolFieldArrayStatus(const char* name, int status);
|
|
|
|
const char* GetVolFieldArrayName(int index);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// pointField selection list control
|
|
|
|
vtkDataArraySelection* GetPointFieldSelection();
|
|
|
|
int GetNumberOfPointFieldArrays();
|
|
|
|
int GetPointFieldArrayStatus(const char* name);
|
|
|
|
void SetPointFieldArrayStatus(const char* name, int status);
|
|
|
|
const char* GetPointFieldArrayName(int index);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// lagrangianField selection list control
|
|
|
|
vtkDataArraySelection* GetLagrangianFieldSelection();
|
|
|
|
int GetNumberOfLagrangianFieldArrays();
|
|
|
|
int GetLagrangianFieldArrayStatus(const char* name);
|
|
|
|
void SetLagrangianFieldArrayStatus(const char* name, int status);
|
|
|
|
const char* GetLagrangianFieldArrayName(int index);
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// Callback registered with the SelectionObserver
|
|
|
|
// for all the selection lists
|
|
|
|
static void SelectionModifiedCallback
|
|
|
|
(
|
|
|
|
vtkObject* caller,
|
|
|
|
unsigned long eid,
|
|
|
|
void* clientdata,
|
|
|
|
void* calldata
|
|
|
|
);
|
|
|
|
|
|
|
|
void SelectionModified();
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
//- Construct null
|
2018-02-20 15:48:10 +00:00
|
|
|
vtkPVFoamReader();
|
2013-12-11 09:25:19 +00:00
|
|
|
|
|
|
|
//- Destructor
|
2018-02-20 15:48:10 +00:00
|
|
|
~vtkPVFoamReader();
|
2013-12-11 09:25:19 +00:00
|
|
|
|
|
|
|
//- Return information about mesh, times, etc without loading anything
|
|
|
|
virtual int RequestInformation
|
|
|
|
(
|
|
|
|
vtkInformation*,
|
|
|
|
vtkInformationVector**,
|
|
|
|
vtkInformationVector*
|
|
|
|
);
|
|
|
|
|
|
|
|
//- Get the mesh/fields for a particular time
|
|
|
|
//- Destructor
|
|
|
|
virtual int RequestData
|
|
|
|
(
|
|
|
|
vtkInformation*,
|
|
|
|
vtkInformationVector**,
|
|
|
|
vtkInformationVector*
|
|
|
|
);
|
|
|
|
|
|
|
|
//- Fill in additional port information
|
|
|
|
virtual int FillOutputPortInformation(int, vtkInformation*);
|
|
|
|
|
|
|
|
// The observer to modify this object when array selections are modified
|
|
|
|
vtkCallbackCommand* SelectionObserver;
|
|
|
|
|
|
|
|
char* FileName;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
//- Disallow default bitwise copy construct
|
2018-02-20 15:48:10 +00:00
|
|
|
vtkPVFoamReader(const vtkPVFoamReader&);
|
2013-12-11 09:25:19 +00:00
|
|
|
|
|
|
|
//- Disallow default bitwise assignment
|
2018-02-20 15:48:10 +00:00
|
|
|
void operator=(const vtkPVFoamReader&);
|
2013-12-11 09:25:19 +00:00
|
|
|
|
|
|
|
//- Add patch names to the view
|
|
|
|
void addPatchNamesToView();
|
|
|
|
|
|
|
|
//- Remove patch names from the view
|
|
|
|
void removePatchNamesFromView();
|
|
|
|
|
|
|
|
int TimeStepRange[2];
|
|
|
|
int CacheMesh;
|
|
|
|
|
|
|
|
int ExtrapolatePatches;
|
2018-02-20 15:48:10 +00:00
|
|
|
int UseVTKPolyhedron;
|
2013-12-11 09:25:19 +00:00
|
|
|
int IncludeSets;
|
|
|
|
int IncludeZones;
|
|
|
|
int ShowPatchNames;
|
|
|
|
|
|
|
|
//- Dummy variable/switch for invoke a reader update
|
|
|
|
int UpdateGUI;
|
|
|
|
|
|
|
|
vtkDataArraySelection* PartSelection;
|
|
|
|
vtkDataArraySelection* VolFieldSelection;
|
|
|
|
vtkDataArraySelection* PointFieldSelection;
|
|
|
|
vtkDataArraySelection* LagrangianFieldSelection;
|
|
|
|
|
|
|
|
//- Cached data for output port0 (experimental!)
|
|
|
|
vtkMultiBlockDataSet* output0_;
|
|
|
|
|
|
|
|
//BTX
|
2018-02-20 15:48:10 +00:00
|
|
|
Foam::vtkPVFoam* foamData_;
|
2013-12-11 09:25:19 +00:00
|
|
|
//ETX
|
|
|
|
};
|
|
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// ************************************************************************* //
|