]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Group.hxx
Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[modules/med.git] / src / MEDMEM / MEDMEM_Group.hxx
1 /*
2  File Group.hxx
3  $Header$
4 */
5
6 #ifndef GROUP_HXX
7 #define GROUP_HXX
8
9 #include <vector>
10 #include <list>
11 #include "MEDMEM_Family.hxx"
12
13
14 /*!
15
16   This class describe a group of elements on an entity.\n
17   It inherits from SUPPORT.\n
18   It is a blending of some FAMILY class.\n\n
19
20 */
21
22 namespace MEDMEM {
23 class FAMILY;
24 class GROUP : virtual public SUPPORT
25 {
26 protected :
27   /*!
28     \if developper
29     Number of families in the group.
30     \endif
31   */
32   int             _numberOfFamilies ;
33   /*!
34     \if developper
35     Vector of families in the group.
36     Note that Families are numbered from 1 to N.
37     \endif
38   */
39   vector<FAMILY*> _family ;
40   
41 public:
42   /*! Constructor. */
43   GROUP();
44   /*! Constructor. */
45   GROUP(const string & name, const list<FAMILY*> & family) throw (MEDEXCEPTION) ;
46   /*! Copy Constructor. */
47   GROUP(const GROUP & m);
48   /*! Destructor. */
49   virtual ~GROUP();
50
51   /*! Copy operator. */
52   // PN ATTention il n y a pas de copie du vecteur Family ????
53   GROUP & operator=(const GROUP &group);
54
55   /*! Operator << */
56   friend ostream & operator<<(ostream &os, GROUP &my) ;
57
58   inline void setNumberOfFamilies(int numberOfFamilies);
59   inline void setFamilies(vector<FAMILY*> Family);
60   
61   inline int             getNumberOfFamilies() const ;
62   inline vector<FAMILY*> getFamilies() const ;
63   inline FAMILY *        getFamily(int i) const ;
64
65 };
66
67 // inline method :
68
69 /*! set the attribut _numberOfFamilies to numberOfFamilies */
70 //----------------------------------------------------------
71 inline void GROUP::setNumberOfFamilies(int numberOfFamilies) 
72 //----------------------------------------------------------
73 {
74   _numberOfFamilies = numberOfFamilies; 
75 };
76
77
78 /*! set the attribut _family to Family              */
79 //----------------------------------------------------
80 inline void GROUP::setFamilies(vector<FAMILY*> Family) 
81 //----------------------------------------------------
82
83   _family = Family; 
84 };
85
86 /*! returns number of families in the group */
87 //--------------------------------------------
88 inline int GROUP::getNumberOfFamilies() const        
89 //-------------------------------------------
90
91   return _numberOfFamilies; 
92 };
93
94 /*! returns the vector of families in the group */
95 //------------------------------------------------
96 inline vector<FAMILY*> GROUP::getFamilies() const 
97 //------------------------------------------------
98
99   return _family; 
100 };
101
102 /*! returns  a reference on family I of the group */
103 //--------------------------------------------------
104 FAMILY * GROUP::getFamily(int i) const   
105 //--------------------------------------------------
106
107   return _family[i-1]; 
108 };
109 }//End namespace MEDMEM
110
111 #endif /* GROUP_HXX */