src/MEDMEM/MEDMEM_Family.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00003 // 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either 
00007 // version 2.1 of the License.
00008 // 
00009 // This library is distributed in the hope that it will be useful 
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public  
00015 // License along with this library; if not, write to the Free Software 
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 //
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 #ifndef FAMILY_HXX
00021 #define FAMILY_HXX
00022 
00023 #include <string>
00024 #include "MEDMEM_Support.hxx"
00025 
00036 namespace MEDMEM {
00037 class FAMILY : virtual public SUPPORT
00038 {
00039 protected :
00046   int      _identifier ;
00053   int      _numberOfAttribute ;
00060   PointerOf<int>    _attributeIdentifier ;
00067   PointerOf<int>    _attributeValue ;
00074   PointerOf<string>  _attributeDescription ;
00080   int      _numberOfGroup ;
00086   PointerOf<string> _groupName ;
00087 
00088 public:
00090   FAMILY();
00096   FAMILY( MESH* Mesh, int Identifier, string Name, 
00097        int NumberOfAttribute, int *AttributeIdentifier,
00098           int *AttributeValue, string AttributeDescription,
00099           int NumberOfGroup,   string GroupName,
00100        int * MEDArrayNodeFamily,
00101        int ** MEDArrayCellFamily,
00102        int ** MEDArrayFaceFamily,
00103        int ** MEDArrayEdgeFamily
00104        ) ;
00105 
00107   FAMILY(const FAMILY & m);
00108 
00110   FAMILY(const SUPPORT & s);
00111 
00113   virtual ~FAMILY();
00114   FAMILY & operator=(const FAMILY &fam);
00115   friend ostream & operator<<(ostream &os, FAMILY &my) ;
00116 
00117   friend ostream & operator<<(ostream &os, const FAMILY &my) ;
00118 
00119   bool build(MED_EN::medEntityMesh Entity,int **FamilyNumber);
00120 
00121   // Il faudrait mettre en cohérence les méthodes set
00122   // avec l'opérateur d'affection ! Rmq from EF !!!
00123 
00124   inline void setIdentifier             (int Identifier);        
00125   inline void setNumberOfAttributes     (int NumberOfAttribute);
00126   inline void setAttributesIdentifiers  (int * AttributeIdentifier);
00127   inline void setAttributesValues       (int * AttributeValue);
00128   inline void setAttributesDescriptions (string * AttributeDescription); 
00129   inline void setNumberOfGroups         (int NumberOfGroups);
00130   inline void setGroupsNames            (string * GroupName);
00131 
00132   inline int      getIdentifier()                    const;
00133   inline int      getNumberOfAttributes()            const;
00134   inline const int *    getAttributesIdentifiers()   const;
00135   inline const int *    getAttributesValues()        const;
00136   inline const string * getAttributesDescriptions()  const;
00137   inline int      getNumberOfGroups()                const;
00138   inline const string * getGroupsNames()             const;
00139 
00140   // A FAIRE : VERIFIER LA VALIDITE DES PARAMETRES !
00141   inline int      getAttributeIdentifier(int i)  const;
00142   inline int      getAttributeValue(int i)       const;
00143   inline string   getAttributeDescription(int i) const;
00144   inline string   getGroupName(int i)            const;
00145 };
00146 
00147 // inline methods :
00149 //----------------------------------------------
00150 inline void FAMILY::setIdentifier(int Identifier)         
00151 //----------------------------------------------
00152 { 
00153     _identifier = Identifier; 
00154 }
00155 
00157 //--------------------------------------------------------------
00158 inline void FAMILY::setNumberOfAttributes(int NumberOfAttribute) 
00159 //--------------------------------------------------------------
00160 { 
00161     _numberOfAttribute = NumberOfAttribute; 
00162 }
00163 
00165 //---------------------------------------------------------------------
00166 inline void FAMILY::setAttributesIdentifiers(int * AttributeIdentifier) 
00167 //---------------------------------------------------------------------
00168 { 
00169     _attributeIdentifier = AttributeIdentifier ; 
00170 }
00171 
00173 //-----------------------------------------------------------
00174 inline void FAMILY::setAttributesValues(int * AttributeValue) 
00175 //-----------------------------------------------------------
00176 { 
00177     _attributeValue = AttributeValue ; 
00178 }
00179 
00181 //--------------------------------------------------------------------------
00182 inline void FAMILY::setAttributesDescriptions(string * AttributeDescription) 
00183 //--------------------------------------------------------------------------
00184 { 
00185     _attributeDescription = AttributeDescription ; 
00186 }
00187 
00189 //-------------------------------------------------------
00190 inline void FAMILY::setNumberOfGroups(int NumberOfGroups) 
00191 //-------------------------------------------------------
00192 { 
00193     _numberOfGroup = NumberOfGroups ; 
00194 }
00195 
00197 //----------------------------------------------------
00198 inline void FAMILY::setGroupsNames(string * GroupName) 
00199 //----------------------------------------------------
00200 { 
00201     _groupName = GroupName ; 
00202 }
00205 //--------------------------------------
00206 inline int FAMILY::getIdentifier() const
00207 //--------------------------------------
00208 { 
00209     return _identifier ; 
00210 }
00211 
00213 //----------------------------------------------
00214 inline int FAMILY::getNumberOfAttributes() const
00215 //----------------------------------------------
00216 { 
00217     return _numberOfAttribute ; 
00218 }
00221 //---------------------------------------------------
00222 inline const int * FAMILY::getAttributesIdentifiers() const
00223 //---------------------------------------------------
00224 { 
00225     return _attributeIdentifier ; 
00226 }
00229 //----------------------------------------------------
00230 inline int FAMILY::getAttributeIdentifier(int i) const     
00231 //----------------------------------------------------
00232 { 
00233     return _attributeIdentifier[i-1] ; 
00234 }
00237 //----------------------------------------------
00238 inline const int * FAMILY::getAttributesValues() const
00239 //----------------------------------------------
00240 { 
00241     return _attributeValue ; 
00242 }
00245 //-----------------------------------------------
00246 inline int FAMILY::getAttributeValue(int i) const          
00247 //-----------------------------------------------
00248 { 
00249     return _attributeValue[i-1] ; 
00250 }
00251 //-------------------------------------------------------
00252 inline const string * FAMILY::getAttributesDescriptions() const
00253 //-------------------------------------------------------
00254 { 
00255     return _attributeDescription ; 
00256 }
00259 //--------------------------------------------------------
00260 inline string FAMILY::getAttributeDescription(int i) const 
00261 //--------------------------------------------------------
00262 { 
00263     return _attributeDescription[i-1] ; 
00264 }
00266 //------------------------------------------
00267 inline int FAMILY::getNumberOfGroups() const                   
00268 //------------------------------------------
00269 { 
00270     return _numberOfGroup; 
00271 }
00273 //--------------------------------------------
00274 inline const string * FAMILY::getGroupsNames() const
00275 //--------------------------------------------
00276 { 
00277     return _groupName ; 
00278 }
00281 //---------------------------------------------
00282 inline string FAMILY::getGroupName(int i) const            
00283 //---------------------------------------------
00284 { 
00285     return _groupName[i-1] ; 
00286 }
00287 
00288 }//End namespace MEDMEM
00289 #endif /* FAMILY_HXX */