Salome HOME
Version ok de MED avec MEDGUI.
[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 class FAMILY : public SUPPORT
8 {
9 protected :
10                         /*! Identifier of the family in the mesh
11                             Note : There is precisely one for each family. */
12   int      _identifier ;
13                         /*! Number of attribute of the family */ 
14   int      _numberOfAttribute ;
15                         /*! Array of all attributes' identifiers.
16                             There is one for each attribute.  */ 
17   int *    _attributeIdentifier ;
18                         /*! Array of all attributes' values.
19                             There is one for each attribute.  */ 
20   int *    _attributeValue ;
21                         /*! Array of all attributes' descriptions.
22                             There is one for each attribute.  */ 
23   string * _attributeDescription ;
24
25                         /*! Number of the group the family belongs to */
26   int      _numberOfGroup ;
27                         /*! Name of the group the family belongs to */
28   string * _groupName ;
29
30 public:
31   FAMILY();
32
33   // constructor to use with med driver
34   FAMILY(MESH* Mesh, int Identifier, string Name, int NumberOfAttribute,int *AttributeIdentifier,int *AttributeValue,string AttributeDescription,int NumberOfGroup,string GroupName) ;
35
36   ~FAMILY();
37   FAMILY & operator=(const FAMILY &fam);
38
39   inline void setIdentifier             (int Identifier);        
40   inline void setNumberOfAttributes     (int NumberOfAttribute);
41   inline void setAttributesIdentifiers  (int * AttributeIdentifier);
42   inline void setAttributesValues       (int * AttributeValue);
43   inline void setAttributesDescriptions (string * AttributeDescription); 
44   inline void setNumberOfGroups         (int NumberOfGroups);
45   inline void setGroupsNames            (string * GroupName);
46
47   inline int      getIdentifier()              const;
48   inline int      getNumberOfAttributes()      const;
49   inline int *    getAttributesIdentifiers()   const;
50   inline int *    getAttributesValues()        const;
51   inline string * getAttributesDescriptions()  const;
52   inline int      getNumberOfGroups()          const;
53   inline string * getGroupsNames()             const;
54
55   // A FAIRE : VERIFIER LA VALIDITE DES PARAMETRES !
56   inline int      getAttributeIdentifier(int i)  const;
57   inline int      getAttributeValue(int i)       const;
58   inline string   getAttributeDescription(int i) const;
59   inline string   getGroupName(int i)            const;
60 };
61
62 // inline methods :
63
64 /* Set the attribute _identifier to Identifier. */
65 //----------------------------------------------
66 inline void FAMILY::setIdentifier(int Identifier)         
67 //----------------------------------------------
68
69     _identifier = Identifier; 
70 }
71
72 /* Set the attribute _numberOfAttribute to NumberOfAttribute. */
73 //--------------------------------------------------------------
74 inline void FAMILY::setNumberOfAttributes(int NumberOfAttribute) 
75 //--------------------------------------------------------------
76
77     _numberOfAttribute = NumberOfAttribute; 
78 }
79
80 /* Set the attribute _attributeIdentifier to AttributeIdentifier. */
81 //---------------------------------------------------------------------
82 inline void FAMILY::setAttributesIdentifiers(int * AttributeIdentifier) 
83 //---------------------------------------------------------------------
84
85     _attributeIdentifier = AttributeIdentifier ; 
86 }
87
88 /* Set the attribute _attributeValue to AttributeValue. */
89 //-----------------------------------------------------------
90 inline void FAMILY::setAttributesValues(int * AttributeValue) 
91 //-----------------------------------------------------------
92
93     _attributeValue = AttributeValue ; 
94 }
95
96 /* Set the attribute _identifier to Identifier. */
97 //--------------------------------------------------------------------------
98 inline void FAMILY::setAttributesDescriptions(string * AttributeDescription) 
99 //--------------------------------------------------------------------------
100
101     _attributeDescription = AttributeDescription ; 
102 }
103
104 /* Set the attribute _identifier to Identifier. */
105 //-------------------------------------------------------
106 inline void FAMILY::setNumberOfGroups(int NumberOfGroups) 
107 //-------------------------------------------------------
108
109     _numberOfGroup = NumberOfGroups ; 
110 }
111
112 /* Set the attribute _identifier to Identifier. */
113 //----------------------------------------------------
114 inline void FAMILY::setGroupsNames(string * GroupName) 
115 //----------------------------------------------------
116
117     _groupName = GroupName ; 
118 }
119 //--------------------------------------
120 inline int FAMILY::getIdentifier() const
121 //--------------------------------------
122
123     return _identifier ; 
124 }
125 //----------------------------------------------
126 inline int FAMILY::getNumberOfAttributes() const
127 //----------------------------------------------
128
129     return _numberOfAttribute ; 
130 }
131 //---------------------------------------------------
132 inline int * FAMILY::getAttributesIdentifiers() const
133 //---------------------------------------------------
134
135     return _attributeIdentifier ; 
136 }
137 //----------------------------------------------------
138 inline int FAMILY::getAttributeIdentifier(int i) const     
139 //----------------------------------------------------
140
141     return _attributeIdentifier[i-1] ; 
142 }
143 //----------------------------------------------
144 inline int * FAMILY::getAttributesValues() const             
145 //----------------------------------------------
146
147     return _attributeValue ; 
148 }
149 //-----------------------------------------------
150 inline int FAMILY::getAttributeValue(int i) const          
151 //-----------------------------------------------
152
153     return _attributeValue[i-1] ; 
154 }
155 //-------------------------------------------------------
156 inline string * FAMILY::getAttributesDescriptions() const    
157 //-------------------------------------------------------
158
159     return _attributeDescription ; 
160 }
161 //--------------------------------------------------------
162 inline string FAMILY::getAttributeDescription(int i) const 
163 //--------------------------------------------------------
164
165     return _attributeDescription[i-1] ; 
166 }
167 //------------------------------------------
168 inline int FAMILY::getNumberOfGroups() const                   
169 //------------------------------------------
170
171     return _numberOfGroup; 
172 }
173 //--------------------------------------------
174 inline string * FAMILY::getGroupsNames() const               
175 //--------------------------------------------
176
177     return _groupName ; 
178 }
179 //---------------------------------------------
180 inline string FAMILY::getGroupName(int i) const            
181 //---------------------------------------------
182
183     return _groupName[i-1] ; 
184 }
185   
186
187 #endif /* FAMILY_HXX */