]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Family.hxx
Salome HOME
correct a small bug appearing when using the gcc 3.2.1.
[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   bool build(medEntityMesh Entity,int **FamilyNumber);
99
100   inline void setIdentifier             (int Identifier);        
101   inline void setNumberOfAttributes     (int NumberOfAttribute);
102   inline void setAttributesIdentifiers  (int * AttributeIdentifier);
103   inline void setAttributesValues       (int * AttributeValue);
104   inline void setAttributesDescriptions (string * AttributeDescription); 
105   inline void setNumberOfGroups         (int NumberOfGroups);
106   inline void setGroupsNames            (string * GroupName);
107
108   inline int      getIdentifier()              const;
109   inline int      getNumberOfAttributes()      const;
110   inline int *    getAttributesIdentifiers()   const;
111   inline int *    getAttributesValues()        const;
112   inline string * getAttributesDescriptions()  const;
113   inline int      getNumberOfGroups()          const;
114   inline string * getGroupsNames()             const;
115
116   // A FAIRE : VERIFIER LA VALIDITE DES PARAMETRES !
117   inline int      getAttributeIdentifier(int i)  const;
118   inline int      getAttributeValue(int i)       const;
119   inline string   getAttributeDescription(int i) const;
120   inline string   getGroupName(int i)            const;
121 };
122 };
123
124 using namespace MEDMEM;
125 // inline methods :
126 /*! Sets the attribute _identifier to Identifier. */
127 //----------------------------------------------
128 inline void FAMILY::setIdentifier(int Identifier)         
129 //----------------------------------------------
130
131     _identifier = Identifier; 
132 }
133
134 /*! Sets the attribute _numberOfAttribute to NumberOfAttribute. */
135 //--------------------------------------------------------------
136 inline void FAMILY::setNumberOfAttributes(int NumberOfAttribute) 
137 //--------------------------------------------------------------
138
139     _numberOfAttribute = NumberOfAttribute; 
140 }
141
142 /*! Sets the attribute _attributeIdentifier to AttributeIdentifier. */
143 //---------------------------------------------------------------------
144 inline void FAMILY::setAttributesIdentifiers(int * AttributeIdentifier) 
145 //---------------------------------------------------------------------
146
147     _attributeIdentifier = AttributeIdentifier ; 
148 }
149
150 /*! Sets the attribute _attributeValue to AttributeValue. */
151 //-----------------------------------------------------------
152 inline void FAMILY::setAttributesValues(int * AttributeValue) 
153 //-----------------------------------------------------------
154
155     _attributeValue = AttributeValue ; 
156 }
157
158 /*! Sets the attribute _attributeDescription to  AttributeDescription. */
159 //--------------------------------------------------------------------------
160 inline void FAMILY::setAttributesDescriptions(string * AttributeDescription) 
161 //--------------------------------------------------------------------------
162
163     _attributeDescription = AttributeDescription ; 
164 }
165
166 /*! Sets the attribute _numberOfGroup to NumberOfGroups. */
167 //-------------------------------------------------------
168 inline void FAMILY::setNumberOfGroups(int NumberOfGroups) 
169 //-------------------------------------------------------
170
171     _numberOfGroup = NumberOfGroups ; 
172 }
173
174 /*! Sets the attribute _groupName to GroupName. */
175 //----------------------------------------------------
176 inline void FAMILY::setGroupsNames(string * GroupName) 
177 //----------------------------------------------------
178
179     _groupName = GroupName ; 
180 }
181 /*! Returns the attribute _identifier./n
182    Note that there is one identifier precisely for each family. */
183 //--------------------------------------
184 inline int FAMILY::getIdentifier() const
185 //--------------------------------------
186
187     return _identifier ; 
188 }
189
190 /*! Returns the number of attributes of the family. */
191 //----------------------------------------------
192 inline int FAMILY::getNumberOfAttributes() const
193 //----------------------------------------------
194
195     return _numberOfAttribute ; 
196 }
197 /*! Returns a pointer to attributes identifiers .
198     (There are _numberOfAttribute attributes) */
199 //---------------------------------------------------
200 inline int * FAMILY::getAttributesIdentifiers() const
201 //---------------------------------------------------
202
203     return _attributeIdentifier ; 
204 }
205 /*! Returns identifer of the Ith attribute of the family./n
206    Note that they are numbered from 1 to N */
207 //----------------------------------------------------
208 inline int FAMILY::getAttributeIdentifier(int i) const     
209 //----------------------------------------------------
210
211     return _attributeIdentifier[i-1] ; 
212 }
213 /*! Returns a pointer to attributes values.
214     (There are _numberOfAttribute attributes)*/
215 //----------------------------------------------
216 inline int * FAMILY::getAttributesValues() const             
217 //----------------------------------------------
218
219     return _attributeValue ; 
220 }
221 /*! Returns value of the Ith attribute of the family./n
222    Note that they are numbered from 1 to N */
223 //-----------------------------------------------
224 inline int FAMILY::getAttributeValue(int i) const          
225 //-----------------------------------------------
226
227     return _attributeValue[i-1] ; 
228 }
229 //-------------------------------------------------------
230 inline string * FAMILY::getAttributesDescriptions() const    
231 //-------------------------------------------------------
232
233     return _attributeDescription ; 
234 }
235 /*! Returns description of the Ith attribute of the family/n
236    Note that they are numbered from 1 to N */
237 //--------------------------------------------------------
238 inline string FAMILY::getAttributeDescription(int i) const 
239 //--------------------------------------------------------
240
241     return _attributeDescription[i-1] ; 
242 }
243 /*! Returns the number of groups the family belongs to.*/
244 //------------------------------------------
245 inline int FAMILY::getNumberOfGroups() const                   
246 //------------------------------------------
247
248     return _numberOfGroup; 
249 }
250 /*! Returns a pointer to the names of the groups the family belongs to */
251 //--------------------------------------------
252 inline string * FAMILY::getGroupsNames() const               
253 //--------------------------------------------
254
255     return _groupName ; 
256 }
257 /*! Returns the name of the Ith group the family belongs to./n
258     Note that they are numbered from 1 to N*/
259 //---------------------------------------------
260 inline string FAMILY::getGroupName(int i) const            
261 //---------------------------------------------
262
263     return _groupName[i-1] ; 
264 }
265 #endif /* FAMILY_HXX */