Salome HOME
Merge from V6_main (04/10/2012)
[modules/paravis.git] / src / Plugins / MedReader / IO / vtkMedStructElement.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 __vtkMedStructElement_h_
21 #define __vtkMedStructElement_h_
22
23 #include "vtkObject.h"
24 #include "vtkMed.h"
25 #include "vtkMedSetGet.h"
26
27 class vtkMedVariableAttribute;
28 class vtkMedConstantAttribute;
29 class vtkMedFile;
30 class vtkMedMesh;
31 class vtkMedEntityArray;
32
33 class VTK_EXPORT vtkMedStructElement : public vtkObject
34 {
35 public :
36   static vtkMedStructElement* New();
37   vtkTypeRevisionMacro(vtkMedStructElement, vtkObject)
38   void PrintSelf(ostream& os, vtkIndent indent);
39
40   // Description:
41   // The iterator to identify this struct element model in the med file
42   vtkSetMacro(MedIterator, med_int);
43   vtkGetMacro(MedIterator, med_int);
44
45   // Description:
46   // This is the name of this structural element model
47   vtkSetStringMacro(Name);
48   vtkGetStringMacro(Name);
49
50   // Description:
51   // The Geometry type this structural elements lies on.
52   vtkSetMacro(GeometryType, med_geometry_type);
53   vtkGetMacro(GeometryType, med_geometry_type);
54
55   // Description:
56   // The dimension of this structural elements model
57   vtkSetMacro(ModelDimension, med_int);
58   vtkGetMacro(ModelDimension, med_int);
59
60   // Description:
61   // The name of the support mesh used by this structural element model
62   vtkSetStringMacro(SupportMeshName);
63   vtkGetStringMacro(SupportMeshName);
64
65   // Description:
66   // This is the support mesh instance, corresponding to the above name.
67   virtual void  SetSupportMesh(vtkMedMesh*);
68   vtkGetObjectMacro(SupportMesh, vtkMedMesh);
69
70   // Description:
71   // The type of entity contained in the support mesh
72   vtkSetMacro(SupportEntityType, med_entity_type);
73   vtkGetMacro(SupportEntityType, med_entity_type);
74
75   // Description:
76   // The number of nodes of the support mesh
77   vtkSetMacro(SupportNumberOfNode, med_int);
78   vtkGetMacro(SupportNumberOfNode, med_int);
79
80   // Description:
81   // The number of cells in the support mesh.
82   vtkSetMacro(SupportNumberOfCell, med_int);
83   vtkGetMacro(SupportNumberOfCell, med_int);
84
85   // Description:
86   // The geometry type of the cells in the support mesh
87   vtkSetMacro(SupportGeometryType, med_geometry_type);
88   vtkGetMacro(SupportGeometryType, med_geometry_type);
89
90   // Description:
91   // This boolean is set to true if the attributes are given on a profile
92   vtkSetMacro(AnyProfile, med_bool);
93   vtkGetMacro(AnyProfile, med_bool);
94
95   // Description:
96   // Get the Variable Attributes
97   vtkGetObjectVectorMacro(VariableAttribute, vtkMedVariableAttribute);
98   vtkSetObjectVectorMacro(VariableAttribute, vtkMedVariableAttribute);
99
100   // Description:
101   // Get the Constant Attributes
102   vtkGetObjectVectorMacro(ConstantAttribute, vtkMedConstantAttribute);
103   vtkSetObjectVectorMacro(ConstantAttribute, vtkMedConstantAttribute);
104
105   // Description:
106   // The file this structural element model is stored in.
107   virtual void SetParentFile(vtkMedFile*);
108   vtkGetObjectMacro(ParentFile, vtkMedFile);
109
110   // Description:
111   // This method will use the driver to load the data for this compute step
112   // for all variable attributes from disk.
113   virtual void  LoadVariableAttributes(vtkMedEntityArray*);
114
115   // Description:
116   // returns the size of the connectivity for one structural element.
117   // for MED_PARTICLE elements, it returns the number of nodes
118   // if SupportEntityType == MED_CELL, it returns the number of cells in the
119   // support mesh * the number of node for each cell.
120   // else it returns the number of nodes in the support mesh.
121   virtual int GetConnectivitySize();
122
123 protected:
124   vtkMedStructElement();
125   virtual ~vtkMedStructElement();
126
127   med_int MedIterator;
128   char *Name;
129   med_geometry_type GeometryType;
130   med_int ModelDimension;
131   char *SupportMeshName;
132   med_entity_type SupportEntityType;
133   med_int SupportNumberOfNode;
134   med_int SupportNumberOfCell;
135   med_geometry_type SupportGeometryType;
136   med_bool AnyProfile;
137
138   vtkMedFile* ParentFile;
139   vtkMedMesh* SupportMesh;
140
141   vtkObjectVector<vtkMedVariableAttribute>* VariableAttribute;
142   vtkObjectVector<vtkMedConstantAttribute>* ConstantAttribute;
143
144 private:
145   vtkMedStructElement(const vtkMedStructElement&); // Not implemented.
146   void operator=(const vtkMedStructElement&); // Not implemented.
147
148 };
149
150 #endif //__vtkMedStructElement_h_