00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 /* 00024 File Group.hxx 00025 */ 00026 00027 #ifndef GROUP_HXX 00028 #define GROUP_HXX 00029 00030 #include <MEDMEM.hxx> 00031 00032 #include <vector> 00033 #include <list> 00034 #include "MEDMEM_Family.hxx" 00035 00036 00045 namespace MEDMEM { 00046 class FAMILY; 00047 class GROUP; 00048 MEDMEM_EXPORT std::ostream & operator<<(std::ostream &os, GROUP &my) ; 00049 00050 class MEDMEM_EXPORT GROUP : virtual public SUPPORT 00051 { 00052 protected : 00058 int _numberOfFamilies ; 00065 std::vector<FAMILY*> _family ; 00066 protected: 00068 virtual ~GROUP(); 00069 00070 public: 00072 GROUP(); 00074 GROUP(const std::string & name, const std::list<FAMILY*> & family) throw (MEDEXCEPTION) ; 00076 GROUP(const GROUP & m); 00077 00079 // PN ATTention il n y a pas de copie du vecteur Family ???? 00080 GROUP & operator=(const GROUP &group); 00081 00083 friend std::ostream & operator<<(std::ostream &os, GROUP &my) ; 00084 00085 inline void setNumberOfFamilies(int numberOfFamilies); 00086 inline void setFamilies(std::vector<FAMILY*> Family); 00087 00088 inline int getNumberOfFamilies() const ; 00089 inline std::vector<FAMILY*> getFamilies() const ; 00090 inline FAMILY * getFamily(int i) const ; 00091 00092 }; 00093 00094 // inline method : 00095 00097 //---------------------------------------------------------- 00098 inline void GROUP::setNumberOfFamilies(int numberOfFamilies) 00099 //---------------------------------------------------------- 00100 { 00101 _numberOfFamilies = numberOfFamilies; 00102 } 00103 00104 00106 //---------------------------------------------------- 00107 inline void GROUP::setFamilies(std::vector<FAMILY*> Family) 00108 //---------------------------------------------------- 00109 { 00110 _family = Family; 00111 } 00112 00114 //-------------------------------------------- 00115 inline int GROUP::getNumberOfFamilies() const 00116 //------------------------------------------- 00117 { 00118 return _numberOfFamilies; 00119 } 00120 00122 //------------------------------------------------ 00123 inline std::vector<FAMILY*> GROUP::getFamilies() const 00124 //------------------------------------------------ 00125 { 00126 return _family; 00127 } 00128 00130 //-------------------------------------------------- 00131 FAMILY * GROUP::getFamily(int i) const 00132 //-------------------------------------------------- 00133 { 00134 return _family[i-1]; 00135 } 00136 }//End namespace MEDMEM 00137 00138 #endif /* GROUP_HXX */