Salome HOME
Merge from V6_main (04/10/2012)
[modules/paravis.git] / src / Plugins / MedReader / IO / vtkMedFile.h
1 // Copyright (C) 2010-2012  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.
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 #ifndef __vtkMedFile_h_
21 #define __vtkMedFile_h_
22
23 #include "vtkObject.h"
24 #include "vtkMedSetGet.h"
25
26 class vtkMedMesh;
27 class vtkMedField;
28 class vtkMedProfile;
29 class vtkMedLocalization;
30 class vtkMedLink;
31 class vtkMedDriver;
32 class vtkMedStructElement;
33 class vtkMedEntity;
34
35 class VTK_EXPORT vtkMedFile: public vtkObject
36 {
37 public:
38   static vtkMedFile* New();
39   vtkTypeRevisionMacro(vtkMedFile, vtkObject)
40   void PrintSelf(ostream& os, vtkIndent indent);
41
42   // Description:
43   // Set the file name to read from
44   vtkSetStringMacro(FileName);
45   vtkGetStringMacro(FileName);
46
47   // Description:
48   // This is the description of this file as stored in the med file.
49   vtkGetObjectMacro(MedDriver, vtkMedDriver);
50
51   // Description:
52   // This method tries to create a new driver for this file.
53   // It returns 1 on success, 0 on failure.
54   virtual int CreateDriver();
55
56   // Description:
57   // read information from this file, and create the meta data structure
58   virtual void  ReadInformation();
59
60   // Description:
61   // Container of the meshes.
62   vtkGetObjectVectorMacro(Mesh, vtkMedMesh);
63   vtkSetObjectVectorMacro(Mesh, vtkMedMesh);
64   virtual vtkMedMesh* GetMesh(const char*);
65
66   // Description:
67   // Container of the fields.
68   vtkGetObjectVectorMacro(Field, vtkMedField);
69   vtkSetObjectVectorMacro(Field, vtkMedField);
70
71   // Description:
72   // Container of the fields.
73   vtkGetObjectVectorMacro(Link, vtkMedLink);
74   vtkSetObjectVectorMacro(Link, vtkMedLink);
75
76   // Description:
77   // Container of the profiles.
78   vtkGetObjectVectorMacro(Profile, vtkMedProfile);
79   vtkSetObjectVectorMacro(Profile, vtkMedProfile);
80   virtual vtkMedProfile*  GetProfile(const char*);
81
82   // Description:
83   // Container of the quadrature definitions.
84   vtkGetObjectVectorMacro(Localization, vtkMedLocalization);
85   vtkSetObjectVectorMacro(Localization, vtkMedLocalization);
86   virtual vtkMedLocalization* GetLocalization(const char*);
87
88   // Description:
89   // This is the description of this file as stored in the med file.
90   vtkSetStringMacro(Comment);
91   vtkGetStringMacro(Comment);
92
93   // Description:
94   // Those 3 numbers describe the version of med used to create this file.
95   vtkSetMacro(VersionMajor, int);
96   vtkGetMacro(VersionMajor, int);
97   vtkSetMacro(VersionMinor, int);
98   vtkGetMacro(VersionMinor, int);
99   vtkSetMacro(VersionRelease, int);
100   vtkGetMacro(VersionRelease, int);
101
102   // Description:
103   // Get the structural elements models
104   vtkGetObjectVectorMacro(StructElement, vtkMedStructElement);
105   vtkSetObjectVectorMacro(StructElement, vtkMedStructElement);
106   vtkMedStructElement* GetStructElement(const vtkMedEntity&);
107
108   // Description:
109   // Get the support mesh informations
110   vtkGetObjectVectorMacro(SupportMesh, vtkMedMesh);
111   vtkSetObjectVectorMacro(SupportMesh, vtkMedMesh);
112
113 protected:
114   vtkMedFile();
115   virtual ~vtkMedFile();
116
117   char * FileName;
118   vtkMedDriver* MedDriver;
119   virtual void  SetMedDriver(vtkMedDriver*);
120
121   int VersionMajor;
122   int VersionMinor;
123   int VersionRelease;
124
125   char* Comment;
126   //BTX
127   vtkObjectVector<vtkMedMesh>* Mesh;
128   vtkObjectVector<vtkMedField>* Field;
129   vtkObjectVector<vtkMedProfile>* Profile;
130   vtkObjectVector<vtkMedLocalization>* Localization;
131   vtkObjectVector<vtkMedLink>* Link;
132   vtkObjectVector<vtkMedStructElement>* StructElement;
133   vtkObjectVector<vtkMedMesh>* SupportMesh;
134   //ETX
135
136 private:
137   vtkMedFile(const vtkMedFile&); // Not implemented.
138   void operator=(const vtkMedFile&); // Not implemented.
139 };
140
141 #endif //__vtkMedMetaData_h_