1 |
|
5 |
//------------------------------------------------------------
|
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 |
|
|
|
79 |
|
|
void MG_COQUE::enregistrer(std::ostream& o)
|
80 |
|
|
{
|
81 |
|
|
o << "%" << get_id() << "=COQUE(" << get_idoriginal() << ",(";
|
82 |
|
|
for (unsigned int i=0;i<lst_coquille.size();i++)
|
83 |
|
|
{
|
84 |
|
|
o << "$" << lst_coquille[i]->get_id();
|
85 |
|
|
if (i!=lst_coquille.size()-1) o << ","; else o << ")";
|
86 |
|
|
}
|
87 |
|
|
int nb=get_nb_ccf();
|
88 |
|
|
o << "," << num_materiau << "," << nb;
|
89 |
|
|
if (nb!=0)
|
90 |
|
|
{
|
91 |
|
|
o << ",(";
|
92 |
|
|
for (int i=0;i<nb;i++)
|
93 |
|
|
{
|
94 |
|
|
char nom[3];
|
95 |
|
|
get_type_ccf(i,nom);
|
96 |
|
|
o << "(" << nom << "," << get_valeur_ccf(i) << ")";
|
97 |
|
|
if (i!=nb-1) o << "," ;
|
98 |
|
|
}
|
99 |
|
|
o << ")";
|
100 |
|
|
}
|
101 |
|
|
o << ");" << std::endl;
|
102 |
|
|
}
|
103 |
|
|
|
104 |
|
|
void MG_COQUE::change_num_materiau(int num)
|
105 |
|
|
{
|
106 |
|
|
num_materiau=num;
|
107 |
|
|
}
|
108 |
|
|
|
109 |
|
|
int MG_COQUE::get_num_materiau(void)
|
110 |
|
|
{
|
111 |
|
|
return num_materiau;
|
112 |
|
|
}
|
113 |
|
|
|
114 |
|
|
|