5 #include "MEDMEM_Support.hxx"
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
14 All families on one entity represent a mesh partition for this entity.
18 class FAMILY : virtual public SUPPORT
23 Identifier of the family in the mesh
24 Note : There is precisely one for each family.
30 Number of attribute of the family ./n
31 Note that attributes are numbered from 1 to N.
34 int _numberOfAttribute ;
37 Array of all attributes' identifiers.
38 There is one for each attribute.
41 int * _attributeIdentifier ;
44 Array of all attributes' values.
45 There is one for each attribute.
48 int * _attributeValue ;
51 Array of all attributes' descriptions.
52 There is one for each attribute.
55 string * _attributeDescription ;
58 Number of the group the family belongs to.
64 Name of the group the family belongs to.
74 Constructor to use with med driver.
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
87 /*! Copy Constructor. */
88 FAMILY(const FAMILY & m);
90 /*! Constructor with SUPPORT entry. */
91 FAMILY(const SUPPORT & s);
95 FAMILY & operator=(const FAMILY &fam);
96 friend ostream & operator<<(ostream &os, FAMILY &my) ;
98 friend ostream & operator<<(ostream &os, const FAMILY &my) ;
100 bool build(medEntityMesh Entity,int **FamilyNumber);
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);
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;
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;
126 using namespace MEDMEM;
128 /*! Sets the attribute _identifier to Identifier. */
129 //----------------------------------------------
130 inline void FAMILY::setIdentifier(int Identifier)
131 //----------------------------------------------
133 _identifier = Identifier;
136 /*! Sets the attribute _numberOfAttribute to NumberOfAttribute. */
137 //--------------------------------------------------------------
138 inline void FAMILY::setNumberOfAttributes(int NumberOfAttribute)
139 //--------------------------------------------------------------
141 _numberOfAttribute = NumberOfAttribute;
144 /*! Sets the attribute _attributeIdentifier to AttributeIdentifier. */
145 //---------------------------------------------------------------------
146 inline void FAMILY::setAttributesIdentifiers(int * AttributeIdentifier)
147 //---------------------------------------------------------------------
149 _attributeIdentifier = AttributeIdentifier ;
152 /*! Sets the attribute _attributeValue to AttributeValue. */
153 //-----------------------------------------------------------
154 inline void FAMILY::setAttributesValues(int * AttributeValue)
155 //-----------------------------------------------------------
157 _attributeValue = AttributeValue ;
160 /*! Sets the attribute _attributeDescription to AttributeDescription. */
161 //--------------------------------------------------------------------------
162 inline void FAMILY::setAttributesDescriptions(string * AttributeDescription)
163 //--------------------------------------------------------------------------
165 _attributeDescription = AttributeDescription ;
168 /*! Sets the attribute _numberOfGroup to NumberOfGroups. */
169 //-------------------------------------------------------
170 inline void FAMILY::setNumberOfGroups(int NumberOfGroups)
171 //-------------------------------------------------------
173 _numberOfGroup = NumberOfGroups ;
176 /*! Sets the attribute _groupName to GroupName. */
177 //----------------------------------------------------
178 inline void FAMILY::setGroupsNames(string * GroupName)
179 //----------------------------------------------------
181 _groupName = GroupName ;
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 //--------------------------------------
192 /*! Returns the number of attributes of the family. */
193 //----------------------------------------------
194 inline int FAMILY::getNumberOfAttributes() const
195 //----------------------------------------------
197 return _numberOfAttribute ;
199 /*! Returns a pointer to attributes identifiers .
200 (There are _numberOfAttribute attributes) */
201 //---------------------------------------------------
202 inline int * FAMILY::getAttributesIdentifiers() const
203 //---------------------------------------------------
205 return _attributeIdentifier ;
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 //----------------------------------------------------
213 return _attributeIdentifier[i-1] ;
215 /*! Returns a pointer to attributes values.
216 (There are _numberOfAttribute attributes)*/
217 //----------------------------------------------
218 inline int * FAMILY::getAttributesValues() const
219 //----------------------------------------------
221 return _attributeValue ;
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 //-----------------------------------------------
229 return _attributeValue[i-1] ;
231 //-------------------------------------------------------
232 inline string * FAMILY::getAttributesDescriptions() const
233 //-------------------------------------------------------
235 return _attributeDescription ;
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 //--------------------------------------------------------
243 return _attributeDescription[i-1] ;
245 /*! Returns the number of groups the family belongs to.*/
246 //------------------------------------------
247 inline int FAMILY::getNumberOfGroups() const
248 //------------------------------------------
250 return _numberOfGroup;
252 /*! Returns a pointer to the names of the groups the family belongs to */
253 //--------------------------------------------
254 inline string * FAMILY::getGroupsNames() const
255 //--------------------------------------------
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 //---------------------------------------------
265 return _groupName[i-1] ;
267 #endif /* FAMILY_HXX */