]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Family.hxx
Salome HOME
DCQ : Merge with Ecole Ete a6.
[modules/med.git] / src / MEDMEM / MEDMEM_Family.hxx
1 #ifndef FAMILY_HXX
2 #define FAMILY_HXX
3
4 #include <string>
5 #include "MEDMEM_Support.hxx"
6
7 /*!
8
9   This class describe a family of elements on an entity./n
10   It inherits from support. /n
11   It contains a list of elements (by SUPPORT class inheritance)
12   and a description of some attributs./n
13
14   All families on one entity represent a mesh partition for this entity.
15
16 */
17 namespace MEDMEM {
18 class FAMILY : virtual public SUPPORT
19 {
20 protected :
21   /*!
22     \if developper
23     Identifier of the family in the mesh
24     Note : There is precisely one for each family.
25     \endif
26   */
27   int      _identifier ;
28   /*!
29     \if developper
30     Number of attribute of the family ./n
31     Note that attributes are numbered from 1 to N.
32     \endif
33   */
34   int      _numberOfAttribute ;
35   /*!
36     \if developper
37     Array of all attributes' identifiers.
38     There is one for each attribute.
39     \endif
40   */ 
41   int *    _attributeIdentifier ;
42   /*!
43     \if developper
44     Array of all attributes' values.
45     There is one for each attribute.
46     \endif
47   */
48   int *    _attributeValue ;
49   /*!
50     \if developper
51     Array of all attributes' descriptions.
52     There is one for each attribute.
53     \endif
54   */
55   string * _attributeDescription ;
56   /*!
57     \if developper
58     Number of the group the family belongs to.
59     \endif
60   */
61   int      _numberOfGroup ;
62   /*!
63     \if developper
64     Name of the group the family belongs to.
65     \endif
66   */
67   string * _groupName ;
68
69 public:
70                         /*! Constructor. */
71   FAMILY();
72   /*!
73     \if developper
74     Constructor to use with med driver.
75     \endif
76   */
77   FAMILY( MESH* Mesh, int Identifier, string Name, 
78           int NumberOfAttribute, int *AttributeIdentifier,
79           int *AttributeValue, string AttributeDescription,
80           int NumberOfGroup,   string GroupName,
81           int * MEDArrayNodeFamily,
82           int ** MEDArrayCellFamily,
83           int ** MEDArrayFaceFamily,
84           int ** MEDArrayEdgeFamily
85           ) ;
86
87                         /*! Copy Constructor. */
88   FAMILY(const FAMILY & m);
89
90                         /*! Constructor with SUPPORT entry. */
91   FAMILY(const SUPPORT & s);
92
93                         /*! Destructor. */
94   virtual ~FAMILY();
95   FAMILY & operator=(const FAMILY &fam);
96   friend ostream & operator<<(ostream &os, FAMILY &my) ;
97
98   friend ostream & operator<<(ostream &os, const FAMILY &my) ;
99
100   bool build(medEntityMesh Entity,int **FamilyNumber);
101
102   inline void setIdentifier             (int Identifier);        
103   inline void setNumberOfAttributes     (int NumberOfAttribute);
104   inline void setAttributesIdentifiers  (int * AttributeIdentifier);
105   inline void setAttributesValues       (int * AttributeValue);
106   inline void setAttributesDescriptions (string * AttributeDescription); 
107   inline void setNumberOfGroups         (int NumberOfGroups);
108   inline void setGroupsNames            (string * GroupName);
109
110   inline int      getIdentifier()              const;
111   inline int      getNumberOfAttributes()      const;
112   inline int *    getAttributesIdentifiers()   const;
113   inline int *    getAttributesValues()        const;
114   inline string * getAttributesDescriptions()  const;
115   inline int      getNumberOfGroups()          const;
116   inline string * getGroupsNames()             const;
117
118   // A FAIRE : VERIFIER LA VALIDITE DES PARAMETRES !
119   inline int      getAttributeIdentifier(int i)  const;
120   inline int      getAttributeValue(int i)       const;
121   inline string   getAttributeDescription(int i) const;
122   inline string   getGroupName(int i)            const;
123 };
124 };
125
126 using namespace MEDMEM;
127 // inline methods :
128 /*! Sets the attribute _identifier to Identifier. */
129 //----------------------------------------------
130 inline void FAMILY::setIdentifier(int Identifier)         
131 //----------------------------------------------
132
133     _identifier = Identifier; 
134 }
135
136 /*! Sets the attribute _numberOfAttribute to NumberOfAttribute. */
137 //--------------------------------------------------------------
138 inline void FAMILY::setNumberOfAttributes(int NumberOfAttribute) 
139 //--------------------------------------------------------------
140
141     _numberOfAttribute = NumberOfAttribute; 
142 }
143
144 /*! Sets the attribute _attributeIdentifier to AttributeIdentifier. */
145 //---------------------------------------------------------------------
146 inline void FAMILY::setAttributesIdentifiers(int * AttributeIdentifier) 
147 //---------------------------------------------------------------------
148
149     _attributeIdentifier = AttributeIdentifier ; 
150 }
151
152 /*! Sets the attribute _attributeValue to AttributeValue. */
153 //-----------------------------------------------------------
154 inline void FAMILY::setAttributesValues(int * AttributeValue) 
155 //-----------------------------------------------------------
156
157     _attributeValue = AttributeValue ; 
158 }
159
160 /*! Sets the attribute _attributeDescription to  AttributeDescription. */
161 //--------------------------------------------------------------------------
162 inline void FAMILY::setAttributesDescriptions(string * AttributeDescription) 
163 //--------------------------------------------------------------------------
164
165     _attributeDescription = AttributeDescription ; 
166 }
167
168 /*! Sets the attribute _numberOfGroup to NumberOfGroups. */
169 //-------------------------------------------------------
170 inline void FAMILY::setNumberOfGroups(int NumberOfGroups) 
171 //-------------------------------------------------------
172
173     _numberOfGroup = NumberOfGroups ; 
174 }
175
176 /*! Sets the attribute _groupName to GroupName. */
177 //----------------------------------------------------
178 inline void FAMILY::setGroupsNames(string * GroupName) 
179 //----------------------------------------------------
180
181     _groupName = GroupName ; 
182 }
183 /*! Returns the attribute _identifier./n
184    Note that there is one identifier precisely for each family. */
185 //--------------------------------------
186 inline int FAMILY::getIdentifier() const
187 //--------------------------------------
188
189     return _identifier ; 
190 }
191
192 /*! Returns the number of attributes of the family. */
193 //----------------------------------------------
194 inline int FAMILY::getNumberOfAttributes() const
195 //----------------------------------------------
196
197     return _numberOfAttribute ; 
198 }
199 /*! Returns a pointer to attributes identifiers .
200     (There are _numberOfAttribute attributes) */
201 //---------------------------------------------------
202 inline int * FAMILY::getAttributesIdentifiers() const
203 //---------------------------------------------------
204
205     return _attributeIdentifier ; 
206 }
207 /*! Returns identifer of the Ith attribute of the family./n
208    Note that they are numbered from 1 to N */
209 //----------------------------------------------------
210 inline int FAMILY::getAttributeIdentifier(int i) const     
211 //----------------------------------------------------
212
213     return _attributeIdentifier[i-1] ; 
214 }
215 /*! Returns a pointer to attributes values.
216     (There are _numberOfAttribute attributes)*/
217 //----------------------------------------------
218 inline int * FAMILY::getAttributesValues() const             
219 //----------------------------------------------
220
221     return _attributeValue ; 
222 }
223 /*! Returns value of the Ith attribute of the family./n
224    Note that they are numbered from 1 to N */
225 //-----------------------------------------------
226 inline int FAMILY::getAttributeValue(int i) const          
227 //-----------------------------------------------
228
229     return _attributeValue[i-1] ; 
230 }
231 //-------------------------------------------------------
232 inline string * FAMILY::getAttributesDescriptions() const    
233 //-------------------------------------------------------
234
235     return _attributeDescription ; 
236 }
237 /*! Returns description of the Ith attribute of the family/n
238    Note that they are numbered from 1 to N */
239 //--------------------------------------------------------
240 inline string FAMILY::getAttributeDescription(int i) const 
241 //--------------------------------------------------------
242
243     return _attributeDescription[i-1] ; 
244 }
245 /*! Returns the number of groups the family belongs to.*/
246 //------------------------------------------
247 inline int FAMILY::getNumberOfGroups() const                   
248 //------------------------------------------
249
250     return _numberOfGroup; 
251 }
252 /*! Returns a pointer to the names of the groups the family belongs to */
253 //--------------------------------------------
254 inline string * FAMILY::getGroupsNames() const               
255 //--------------------------------------------
256
257     return _groupName ; 
258 }
259 /*! Returns the name of the Ith group the family belongs to./n
260     Note that they are numbered from 1 to N*/
261 //---------------------------------------------
262 inline string FAMILY::getGroupName(int i) const            
263 //---------------------------------------------
264
265     return _groupName[i-1] ; 
266 }
267 #endif /* FAMILY_HXX */