1 // Copyright (C) 2010-2012 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __vtkMedField_h_
21 #define __vtkMedField_h_
23 #include "vtkObject.h"
24 #include "vtkMedSetGet.h"
27 #include "vtkSmartPointer.h"
33 class vtkMedInterpolation;
34 class vtkMedFieldOverEntity;
36 class vtkMedFieldStep;
37 class vtkMedComputeStep;
39 class vtkMedComputeStepMap;
42 class VTK_EXPORT vtkMedField: public vtkObject
45 static vtkMedField* New();
46 vtkTypeRevisionMacro(vtkMedField, vtkObject);
47 void PrintSelf(ostream& os, vtkIndent indent);
50 // The number of component of this field
51 virtual void SetNumberOfComponent(int);
52 vtkGetMacro(NumberOfComponent, int);
55 // The type of data stored in this field
56 vtkSetMacro(DataType, med_field_type);
57 vtkGetMacro(DataType, med_field_type);
60 // The name of this field
61 vtkGetStringMacro(Name);
62 vtkSetStringMacro(Name);
65 // The name of this mesh this field is on
66 vtkGetStringMacro(MeshName);
67 vtkSetStringMacro(MeshName);
70 // The name of this mesh this field is on
71 vtkGetStringMacro(TimeUnit);
72 vtkSetStringMacro(TimeUnit);
75 // The units of each component of this field
76 vtkGetObjectMacro(Unit, vtkStringArray);
79 // The name of each component of this field
80 vtkGetObjectMacro(ComponentName, vtkStringArray);
83 // add a cell type as support to this field
84 void AddFieldStep(vtkMedFieldStep*);
85 void ClearFieldStep();
86 vtkMedFieldStep* GetFieldStep(const vtkMedComputeStep&);
87 vtkMedFieldStep* FindFieldStep(const vtkMedComputeStep&, int);
88 med_int GetNumberOfFieldStep();
89 vtkMedFieldStep* GetFieldStep(med_int);
90 void GatherFieldTimes(std::set<med_float>&);
91 void GatherFieldIterations(med_float,std::set<med_int>&);
94 // returns if the field is on point, cell, quadrature point or elno
97 UnknownFieldType = 0x00,
100 QuadratureField = 0x04,
104 // returns the type of field this is. The returned code is and OR between
105 // the different possible types.
106 vtkGetMacro(FieldType, int);
108 // This computes the FieldType
109 // (currently, it does it by looking only at the first compute step)
110 virtual void ComputeFieldType();
113 // This returns true if the FieldType is composed of several types
114 virtual int HasManyFieldTypes();
117 // returns the first support type this field is on.
118 virtual int GetFirstType();
121 // This methods extracts from the other field all the fields that are
122 // on the given support type and add them to the current field.
123 // It also updates the other FieldType ivar.
124 virtual void ExtractFieldType(vtkMedField* otherfield, int type);
127 // The index of this field in the med file
128 vtkSetMacro(MedIterator, med_int);
129 vtkGetMacro(MedIterator, med_int);
132 // if the mesh is local or not.
133 vtkSetMacro(Local, med_int);
134 vtkGetMacro(Local, med_int);
137 // The interpolation functions associated with this field
138 vtkGetObjectVectorMacro(Interpolation, vtkMedInterpolation);
139 vtkSetObjectVectorMacro(Interpolation, vtkMedInterpolation);
142 // This stores the file this field is stored on.
143 virtual void SetParentFile(vtkMedFile*);
144 vtkGetObjectMacro(ParentFile, vtkMedFile);
148 virtual ~vtkMedField();
150 vtkSetMacro(FieldType, int);
152 int NumberOfComponent;
153 med_field_type DataType;
160 vtkMedFile* ParentFile;
163 vtkMedComputeStepMap<vtkMedFieldStep>* FieldStep;
164 vtkObjectVector<vtkMedInterpolation>* Interpolation;
167 vtkStringArray* Unit;
168 vtkStringArray* ComponentName;
171 vtkMedField(const vtkMedField&); // Not implemented.
172 void operator=(const vtkMedField&); // Not implemented.
176 #endif //__vtkMedField_h_