1 |
francois |
283 |
//------------------------------------------------------------ |
2 |
|
|
//------------------------------------------------------------ |
3 |
|
|
// MAGiC |
4 |
|
|
// Jean Christophe Cuilli�re et Vincent FRANCOIS |
5 |
|
|
// D�partement de G�nie M�canique - UQTR |
6 |
|
|
//------------------------------------------------------------ |
7 |
|
|
// Le projet MAGIC est un projet de recherche du d�partement |
8 |
|
|
// de g�nie m�canique de l'Universit� du Qu�bec � |
9 |
|
|
// Trois Rivi�res |
10 |
|
|
// Les librairies ne peuvent �tre utilis�es sans l'accord |
11 |
|
|
// des auteurs (contact : francois@uqtr.ca) |
12 |
|
|
//------------------------------------------------------------ |
13 |
|
|
//------------------------------------------------------------ |
14 |
|
|
// |
15 |
|
|
// mg_coquille.cpp |
16 |
|
|
// |
17 |
|
|
//------------------------------------------------------------ |
18 |
|
|
//------------------------------------------------------------ |
19 |
|
|
// COPYRIGHT 2000 |
20 |
|
|
// Version du 02/03/2006 � 11H22 |
21 |
|
|
//------------------------------------------------------------ |
22 |
|
|
//------------------------------------------------------------ |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
#include "gestionversion.h" |
26 |
|
|
#include "mg_coquille.h" |
27 |
|
|
//#include "message.h" |
28 |
|
|
|
29 |
|
|
MG_COQUILLE::MG_COQUILLE(unsigned long num,class MG_VOLUME* mgvol):MG_ELEMENT_COTOPOLOGIQUE(num),volume(mgvol),coque(NULL) |
30 |
|
|
{ |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
MG_COQUILLE::MG_COQUILLE(unsigned long num,class MG_COQUE* mgcoq):MG_ELEMENT_COTOPOLOGIQUE(num),volume(NULL),coque(mgcoq) |
34 |
|
|
{ |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
|
38 |
|
|
MG_COQUILLE::MG_COQUILLE(class MG_VOLUME* mgvol):MG_ELEMENT_COTOPOLOGIQUE(),volume(mgvol),coque(NULL) |
39 |
|
|
{ |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
MG_COQUILLE::MG_COQUILLE(class MG_COQUE* mgcoq):MG_ELEMENT_COTOPOLOGIQUE(),volume(NULL),coque(mgcoq) |
43 |
|
|
{ |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
|
47 |
|
|
MG_COQUILLE::MG_COQUILLE(MG_COQUILLE& mdd):MG_ELEMENT_COTOPOLOGIQUE(),volume(mdd.volume),lst_coface(mdd.lst_coface),coque(mdd.coque) |
48 |
|
|
{ |
49 |
|
|
} |
50 |
|
|
|
51 |
|
|
|
52 |
|
|
MG_COQUILLE::~MG_COQUILLE() |
53 |
|
|
{ |
54 |
|
|
} |
55 |
|
|
|
56 |
|
|
|
57 |
|
|
void MG_COQUILLE::ajouter_mg_coface(class MG_COFACE* mgcoface) |
58 |
|
|
{ |
59 |
|
|
lst_coface.insert(lst_coface.end(),mgcoface); |
60 |
|
|
} |
61 |
|
|
|
62 |
|
|
int MG_COQUILLE::get_nb_mg_coface(void) |
63 |
|
|
{ |
64 |
|
|
return lst_coface.size(); |
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
MG_VOLUME* MG_COQUILLE::get_mg_volume(void) |
68 |
|
|
{ |
69 |
|
|
return volume; |
70 |
|
|
} |
71 |
|
|
|
72 |
|
|
MG_COFACE* MG_COQUILLE::get_mg_coface(int num) |
73 |
|
|
{ |
74 |
|
|
return lst_coface[num]; |
75 |
|
|
} |
76 |
|
|
|
77 |
|
|
void MG_COQUILLE::supprimer_mg_coface(class MG_COFACE* mgcoface) |
78 |
|
|
{ |
79 |
|
|
std::vector<MG_COFACE*>::iterator i; |
80 |
|
|
for (i=lst_coface.begin();i!=lst_coface.end();i++) |
81 |
|
|
{ |
82 |
|
|
if ((*i)==mgcoface) |
83 |
|
|
{ |
84 |
|
|
lst_coface.erase(i); |
85 |
|
|
return; |
86 |
|
|
} |
87 |
|
|
} |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
|
91 |
|
|
void MG_COQUILLE::enregistrer(std::ostream& o) |
92 |
|
|
{ |
93 |
|
|
if (volume!=NULL) o << "%" << get_id() << "=COQUILLE($"<< volume->get_id() << ",("; |
94 |
|
|
if (coque!=NULL) o << "%" << get_id() << "=COQUILLE($"<< coque->get_id() << ",("; |
95 |
|
|
for (unsigned int i=0;i<lst_coface.size();i++) |
96 |
|
|
{ |
97 |
|
|
o << "$" << lst_coface[i]->get_id(); |
98 |
|
|
if (i!=lst_coface.size()-1) o << ","; |
99 |
|
|
else o << ")"; |
100 |
|
|
} |
101 |
|
|
o << ");" << std::endl; |
102 |
|
|
} |
103 |
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|