]> SALOME platform Git repositories - tools/paravisaddons_common.git/blob - src/SerafinReader/plugin/SerafinReaderModule/vtkSerafinReader.h
Salome HOME
initial commit from paravisaddons
[tools/paravisaddons_common.git] / src / SerafinReader / plugin / SerafinReaderModule / vtkSerafinReader.h
1 // Copyright (C) 2021  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
20 /*=========================================================================
21
22   Program:   Visualization Toolkit
23   Module:    $RCSfile: vtkSerafinReader.h,v $
24
25   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
26   All rights reserved.
27   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
28
29      This software is distributed WITHOUT ANY WARRANTY; without even
30      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
31      PURPOSE.  See the above copyright notice for more information.
32
33 =========================================================================*/
34
35 ////// Reader for files generated by The  TELEMAC modelling system \\\\\
36 // Module developped by herve ozdoba - Sept 2008 ( herve-externe.ozdoba at edf.fr / herve at ozdoba.fr )
37 // Please address all comments to Regina Nebauer ( regina.nebauer at edf.fr )
38 // >>> Test version
39
40 #ifndef __vtkSerafinReader_h__
41 #define __vtkSerafinReader_h__
42
43 /** -- Inclusions issues de la bibliotheque standard du C++ -- */
44
45 #include <fstream>
46 #include <string>
47 #include <cstdio>
48 #include <iostream>
49 #include <cstring>
50
51 using namespace std;
52
53 /** -- Inclusion des entetes de la bibliotheque vtk -- **/
54
55 #include "vtkUnstructuredGridAlgorithm.h"
56
57 #include "vtkStringArray.h"
58
59
60 #include "stdSerafinReader.h"
61
62 #include "vtkIntArray.h"
63 #include "vtkFloatArray.h"
64 #include "vtkStdString.h"
65 #include "vtkDoubleArray.h"
66 #include "vtkIntArray.h"
67 #include "vtkCellArray.h"
68
69
70 /** ********************************************************************************************* **/
71 /** -- Definition de la classe de lecture des fichiers externes au format Serafin pour Telemac -- **/
72 /** ********************************************************************************************* **/
73
74 class VTK_EXPORT vtkSerafinReader  : public vtkUnstructuredGridAlgorithm
75 {
76 public:
77
78   static vtkSerafinReader *New();
79
80   vtkTypeMacro(vtkSerafinReader,vtkUnstructuredGridAlgorithm);
81   void PrintSelf(ostream& os, vtkIndent indent);
82
83   void SetTimeUnit(int);
84
85   vtkSetStringMacro(FileName);
86   vtkGetStringMacro(FileName);
87
88   vtkSetMacro(TimeStep, int);
89   vtkGetMacro(TimeStep, int);
90
91 protected:
92
93   // Implementation du constructeur associe a la classe
94   vtkSerafinReader();
95
96   // Implementation du descructeur
97   ~vtkSerafinReader();
98
99   int RequestInformation  (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
100   int RequestData    (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
101
102   // Lecture de la geometrie du maillage
103   void ReadGeometry   (vtkUnstructuredGrid *output, int time);
104
105   // Lecture des donnees de la simulation au niveau des noeuds et des cellules.
106   void ReadData   (vtkUnstructuredGrid *output, int time);
107
108   char    *FileName;   // Nom du fichier ouvert par le logiciel Paraview
109   ifstream *FileStream;// Flux de lecture du fichier
110
111   int TimeStep;
112
113   stdSerafinReader* Reader; /** /!\ Instance de lecture du fichier Serafin **/
114
115   class vtkInternal;
116   vtkInternal *Internal;
117
118 private:
119   vtkSerafinReader(const vtkSerafinReader&);  // Pas implemente
120   void operator=(const vtkSerafinReader&);    // Pas implemente
121
122 }; /* class_vtkSerafinReader */
123
124 #endif