]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Group.hxx
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM / MEDMEM_Group.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 /*
23  File Group.hxx
24  $Header$
25 */
26
27 #ifndef GROUP_HXX
28 #define GROUP_HXX
29
30 #include <MEDMEM.hxx>
31
32 #include <vector>
33 #include <list>
34 #include "MEDMEM_Family.hxx"
35
36
37 /*!
38
39   This class describe a group of elements on an entity.\n
40   It inherits from SUPPORT.\n
41   It is a blending of some FAMILY class.\n\n
42
43 */
44
45 namespace MEDMEM {
46   class FAMILY;
47   class GROUP;
48   ostream & operator<<(ostream &os, GROUP &my) ;
49
50 class MEDMEM_EXPORT GROUP : virtual public SUPPORT
51 {
52 protected :
53   /*!
54     \if developper
55     Number of families in the group.
56     \endif
57   */
58   int             _numberOfFamilies ;
59   /*!
60     \if developper
61     Vector of families in the group.
62     Note that Families are numbered from 1 to N.
63     \endif
64   */
65   vector<FAMILY*> _family ;
66   
67 public:
68   /*! Constructor. */
69   GROUP();
70   /*! Constructor. */
71   GROUP(const string & name, const list<FAMILY*> & family) throw (MEDEXCEPTION) ;
72   /*! Copy Constructor. */
73   GROUP(const GROUP & m);
74   /*! Destructor. */
75   virtual ~GROUP();
76
77   /*! Copy operator. */
78   // PN ATTention il n y a pas de copie du vecteur Family ????
79   GROUP & operator=(const GROUP &group);
80
81   /*! Operator << */
82   friend ostream & operator<<(ostream &os, GROUP &my) ;
83
84   inline void setNumberOfFamilies(int numberOfFamilies);
85   inline void setFamilies(vector<FAMILY*> Family);
86   
87   inline int             getNumberOfFamilies() const ;
88   inline vector<FAMILY*> getFamilies() const ;
89   inline FAMILY *        getFamily(int i) const ;
90
91 };
92
93 // inline method :
94
95 /*! set the attribut _numberOfFamilies to numberOfFamilies */
96 //----------------------------------------------------------
97 inline void GROUP::setNumberOfFamilies(int numberOfFamilies) 
98 //----------------------------------------------------------
99 {
100   _numberOfFamilies = numberOfFamilies; 
101 }
102
103
104 /*! set the attribut _family to Family              */
105 //----------------------------------------------------
106 inline void GROUP::setFamilies(vector<FAMILY*> Family) 
107 //----------------------------------------------------
108
109   _family = Family; 
110 }
111
112 /*! returns number of families in the group */
113 //--------------------------------------------
114 inline int GROUP::getNumberOfFamilies() const        
115 //-------------------------------------------
116
117   return _numberOfFamilies; 
118 }
119
120 /*! returns the vector of families in the group */
121 //------------------------------------------------
122 inline vector<FAMILY*> GROUP::getFamilies() const 
123 //------------------------------------------------
124
125   return _family; 
126 }
127
128 /*! returns  a reference on family I of the group */
129 //--------------------------------------------------
130 FAMILY * GROUP::getFamily(int i) const   
131 //--------------------------------------------------
132
133   return _family[i-1]; 
134 }
135 }//End namespace MEDMEM
136
137 #endif /* GROUP_HXX */