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_coque.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_coque.h" |
27 |
|
|
//#include "message.h" |
28 |
|
|
|
29 |
|
|
MG_COQUE::MG_COQUE(std::string idori,unsigned long num):MG_ELEMENT_TOPOLOGIQUE(num,idori),num_materiau(-1) |
30 |
|
|
{ |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
MG_COQUE::MG_COQUE(std::string idori):MG_ELEMENT_TOPOLOGIQUE(idori),num_materiau(-1) |
34 |
|
|
{ |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
MG_COQUE::MG_COQUE(MG_COQUE& mdd):MG_ELEMENT_TOPOLOGIQUE(mdd),lst_coquille(mdd.lst_coquille) |
38 |
|
|
{ |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
MG_COQUE::~MG_COQUE() |
42 |
|
|
{ |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
void MG_COQUE::ajouter_mg_coquille(class MG_COQUILLE* mgcoq) |
46 |
|
|
{ |
47 |
|
|
lst_coquille.insert(lst_coquille.end(),mgcoq); |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
void MG_COQUE::supprimer_mg_coquille(class MG_COQUILLE* mgcoq) |
51 |
|
|
{ |
52 |
|
|
std::vector<MG_COQUILLE*>::iterator i; |
53 |
|
|
for (i=lst_coquille.begin();i!=lst_coquille.end();i++) |
54 |
|
|
{ |
55 |
|
|
if ((*i)==mgcoq) |
56 |
|
|
{ |
57 |
|
|
lst_coquille.erase(i); |
58 |
|
|
return; |
59 |
|
|
} |
60 |
|
|
} |
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
|
64 |
|
|
int MG_COQUE::get_nb_mg_coquille(void) |
65 |
|
|
{ |
66 |
|
|
return lst_coquille.size(); |
67 |
|
|
} |
68 |
|
|
|
69 |
|
|
MG_COQUILLE* MG_COQUE::get_mg_coquille(int num) |
70 |
|
|
{ |
71 |
|
|
return lst_coquille[num]; |
72 |
|
|
} |
73 |
|
|
|
74 |
|
|
int MG_COQUE::get_dimension(void) |
75 |
|
|
{ |
76 |
|
|
return 2; |
77 |
|
|
} |
78 |
|
|
void MG_COQUE::get_topologie_sousjacente(TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> *lst) |
79 |
|
|
{ |
80 |
|
|
int nbcoq=lst_coquille.size(); |
81 |
|
|
for (int i=0;i<nbcoq;i++) |
82 |
|
|
{ |
83 |
|
|
MG_COQUILLE* coq=lst_coquille[i]; |
84 |
|
|
int nbface=coq->get_nb_mg_coface(); |
85 |
|
|
for (int j=0;j<nbface;j++) |
86 |
|
|
{ |
87 |
|
|
MG_FACE* face=coq->get_mg_coface(j)->get_face(); |
88 |
|
|
lst->ajouter(face); |
89 |
|
|
face->get_topologie_sousjacente(lst); |
90 |
|
|
} |
91 |
|
|
} |
92 |
|
|
} |
93 |
|
|
void MG_COQUE::enregistrer(std::ostream& o) |
94 |
|
|
{ |
95 |
|
|
o << "%" << get_id() << "=COQUE(" << get_idoriginal() << ",("; |
96 |
|
|
for (unsigned int i=0;i<lst_coquille.size();i++) |
97 |
|
|
{ |
98 |
|
|
o << "$" << lst_coquille[i]->get_id(); |
99 |
|
|
if (i!=lst_coquille.size()-1) o << ","; |
100 |
|
|
else o << ")"; |
101 |
|
|
} |
102 |
|
|
int nb=get_nb_ccf(); |
103 |
|
|
o << "," << num_materiau << "," << nb; |
104 |
|
|
if (nb!=0) |
105 |
|
|
{ |
106 |
|
|
o << ",("; |
107 |
|
|
for (int i=0;i<nb;i++) |
108 |
|
|
{ |
109 |
|
|
char nom[3]; |
110 |
|
|
get_type_ccf(i,nom); |
111 |
|
|
o << "(" << nom << "," << get_valeur_ccf(i) << ")"; |
112 |
|
|
if (i!=nb-1) o << "," ; |
113 |
|
|
} |
114 |
|
|
o << ")"; |
115 |
|
|
} |
116 |
|
|
o << ");" << std::endl; |
117 |
|
|
} |
118 |
|
|
|
119 |
|
|
void MG_COQUE::change_num_materiau(int num) |
120 |
|
|
{ |
121 |
|
|
num_materiau=num; |
122 |
|
|
} |
123 |
|
|
|
124 |
|
|
int MG_COQUE::get_num_materiau(void) |
125 |
|
|
{ |
126 |
|
|
return num_materiau; |
127 |
|
|
} |
128 |
|
|
|
129 |
|
|
VCT& MG_COQUE::get_vectorisation(void) |
130 |
|
|
{ |
131 |
|
|
VCT *p=NULL; |
132 |
|
|
return *p; |
133 |
|
|
} |