1 |
francois |
1158 |
//####//------------------------------------------------------------ |
2 |
|
|
//####//------------------------------------------------------------ |
3 |
|
|
//####// MAGiC |
4 |
|
|
//####// Jean Christophe Cuilliere et Vincent FRANCOIS |
5 |
|
|
//####// Departement de Genie Mecanique - UQTR |
6 |
|
|
//####//------------------------------------------------------------ |
7 |
|
|
//####// MAGIC est un projet de recherche de l equipe ERICCA |
8 |
|
|
//####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres |
9 |
|
|
//####// http://www.uqtr.ca/ericca |
10 |
|
|
//####// http://www.uqtr.ca/ |
11 |
|
|
//####//------------------------------------------------------------ |
12 |
|
|
//####//------------------------------------------------------------ |
13 |
|
|
//####// |
14 |
|
|
//####// mc_materiau.cpp |
15 |
|
|
//####// |
16 |
|
|
//####//------------------------------------------------------------ |
17 |
|
|
//####//------------------------------------------------------------ |
18 |
|
|
//####// COPYRIGHT 2000-2024 |
19 |
|
|
//####// jeu 13 jun 2024 17:15:00 EDT |
20 |
|
|
//####//------------------------------------------------------------ |
21 |
|
|
//####//------------------------------------------------------------ |
22 |
francois |
283 |
|
23 |
|
|
|
24 |
|
|
#include "gestionversion.h" |
25 |
|
|
|
26 |
|
|
#pragma hdrstop |
27 |
|
|
#include <string.h> |
28 |
francois |
296 |
#include "mc_materiau.h" |
29 |
|
|
#include "mc_propriete.h" |
30 |
francois |
283 |
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
francois |
296 |
MC_MATERIAU::MC_MATERIAU(char* valnom,char* valdes) |
35 |
francois |
283 |
{ |
36 |
|
|
nom=valnom; |
37 |
|
|
description=valdes; |
38 |
|
|
} |
39 |
|
|
|
40 |
francois |
296 |
MC_MATERIAU::~MC_MATERIAU() |
41 |
francois |
283 |
{ |
42 |
|
|
while (lst_prop.get_nb()!=0) |
43 |
|
|
{ |
44 |
francois |
296 |
MC_PROPRIETE* mprop=lst_prop.get(0); |
45 |
francois |
283 |
lst_prop.supprimer(mprop); |
46 |
|
|
delete mprop; |
47 |
|
|
} |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
francois |
296 |
MC_PROPRIETE* MC_MATERIAU::ajouter_propriete(char* nom,double val1,char* unite1,double val2,char* unite2,double val3,char* unite3) |
54 |
francois |
283 |
{ |
55 |
francois |
296 |
MC_PROPRIETE* mprop=new MC_PROPRIETE(nom); |
56 |
francois |
283 |
mprop->change_valeur(0,val1); |
57 |
|
|
mprop->change_valeur(1,val2); |
58 |
|
|
mprop->change_valeur(2,val3); |
59 |
|
|
mprop->change_unite(0,unite1); |
60 |
|
|
mprop->change_unite(1,unite2); |
61 |
|
|
mprop->change_unite(2,unite3); |
62 |
|
|
lst_prop.ajouter(mprop); |
63 |
|
|
return mprop; |
64 |
|
|
} |
65 |
|
|
|
66 |
francois |
296 |
int MC_MATERIAU::get_nb_propriete() |
67 |
francois |
283 |
{ |
68 |
|
|
return lst_prop.get_nb(); |
69 |
|
|
} |
70 |
|
|
|
71 |
francois |
296 |
MC_PROPRIETE* MC_MATERIAU::get_propriete(int num) |
72 |
francois |
283 |
{ |
73 |
|
|
return lst_prop.get(num); |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
|
77 |
francois |
296 |
char* MC_MATERIAU::get_nom(void) |
78 |
francois |
283 |
{ |
79 |
|
|
return (char*)nom.c_str(); |
80 |
|
|
} |
81 |
|
|
|
82 |
francois |
296 |
char* MC_MATERIAU::get_description(void) |
83 |
francois |
283 |
{ |
84 |
|
|
return (char*)description.c_str(); |
85 |
|
|
} |
86 |
|
|
|
87 |
|
|
|
88 |
francois |
296 |
class MC_PROPRIETE* MC_MATERIAU::get_propriete(char *nom) |
89 |
francois |
283 |
{ |
90 |
|
|
int nb_prop=lst_prop.get_nb(); |
91 |
|
|
for (int i=0;i<nb_prop;i++) |
92 |
|
|
{ |
93 |
francois |
296 |
MC_PROPRIETE* prop=lst_prop.get(i); |
94 |
francois |
283 |
if (strcmp(prop->get_nom(),nom)==0) return prop; |
95 |
|
|
} |
96 |
|
|
|
97 |
|
|
return NULL; |
98 |
|
|
} |
99 |
|
|
|