Salome HOME
Copyright update 2022
[modules/paravis.git] / src / Plugins / MEDReader / plugin / MEDReaderIO / vtkMEDReader.h
1 // Copyright (C) 2010-2022  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay
20
21 #ifndef __vtkMEDReader_h_
22 #define __vtkMEDReader_h_
23
24 #include <string>
25
26 #include "vtkMultiBlockDataSetAlgorithm.h"
27 #include "vtkInformationGaussDoubleVectorKey.h"
28
29 class vtkDataSet;
30 class vtkMutableDirectedGraph;
31 class vtkInformationDataObjectMetaDataKey;
32 class vtkInformationDoubleVectorKey;
33 class ExportedTinyInfo;
34
35 class VTK_EXPORT vtkMEDReader : public vtkMultiBlockDataSetAlgorithm
36 {
37  private:
38   vtkMEDReader(const vtkMEDReader&); // Not implemented.
39   void operator=(const vtkMEDReader&); // Not implemented.
40  public:
41   static vtkMEDReader *New();
42   vtkTypeMacro(vtkMEDReader, vtkMultiBlockDataSetAlgorithm)
43   void PrintSelf(ostream& os, vtkIndent indent);
44   virtual void SetFileName(const char*);
45   virtual char *GetFileName();
46   virtual const char *GetFileExtensions() { return ".med .rmed"; }
47   virtual const char *GetDescriptiveName() { return "MED file (Data Exchange Model)"; }
48   //
49   virtual void SetFieldsStatus(const char *name, int status);
50   virtual int GetNumberOfFieldsTreeArrays();
51   virtual const char *GetFieldsTreeArrayName(int index);
52   virtual int GetFieldsTreeArrayStatus(const char *name);
53   //
54   virtual int GetTimesFlagsArrayStatus(const char *name);
55   virtual void SetTimesFlagsStatus(const char *name, int status);
56   virtual int GetNumberOfTimesFlagsArrays();
57   virtual const char *GetTimesFlagsArrayName(int index);
58   //! Build the graph used to pass information to the client on the supports
59   virtual std::string BuildSIL(vtkMutableDirectedGraph*);
60
61   // Description
62   // Reload will delete the internal reader and recreate it with default properties
63   virtual void Reload();
64
65   virtual void GenerateVectors(int);
66   virtual void ChangeMode(int);
67   virtual void GhostCellGeneratorCallForPara(int);
68   static const char *GetSeparator();
69
70   // Description
71   // Static information key used to transfer the meta data graph along the pipeline
72   static vtkInformationDataObjectMetaDataKey* META_DATA();
73   static vtkInformationGaussDoubleVectorKey* GAUSS_DATA();
74
75  protected:
76   vtkMEDReader();
77   virtual ~vtkMEDReader();
78   virtual int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
79   virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
80  private:
81   void UpdateSIL(vtkInformation * request, vtkInformation * info);
82   virtual double PublishTimeStepsIfNeeded(vtkInformation*, bool& isUpdated);
83   virtual void FillMultiBlockDataSetInstance(vtkMultiBlockDataSet *output, double reqTS, ExportedTinyInfo *internalInfo=0);
84   vtkDataSet *RetrieveDataSetAtTime(double reqTS, ExportedTinyInfo *internalInfo);
85  private:
86   //BTX
87   //ETX
88
89   class vtkMEDReaderInternal;
90   vtkMEDReaderInternal* Internal;
91 };
92
93 #endif //__vtkMEDReader_h_