ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_coquille.cpp
Revision: 880
Committed: Tue Apr 4 20:12:48 2017 UTC (8 years, 4 months ago) by francois
File size: 4055 byte(s)
Log Message:
ajout des executables pour le mailleur couche

File Contents

# Content
1 //------------------------------------------------------------
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 "mg_coque.h"
28 //#include "message.h"
29
30 MG_COQUILLE::MG_COQUILLE(unsigned long num,class MG_VOLUME* mgvol):MG_ELEMENT_COTOPOLOGIQUE(num),volume(mgvol),coque(NULL),mince(false)
31 {
32 }
33
34 MG_COQUILLE::MG_COQUILLE(unsigned long num,class MG_COQUE* mgcoq):MG_ELEMENT_COTOPOLOGIQUE(num),volume(NULL),coque(mgcoq),mince(false)
35 {
36 }
37
38
39 MG_COQUILLE::MG_COQUILLE(class MG_VOLUME* mgvol):MG_ELEMENT_COTOPOLOGIQUE(),volume(mgvol),coque(NULL),mince(false)
40 {
41 }
42
43 MG_COQUILLE::MG_COQUILLE(class MG_COQUE* mgcoq):MG_ELEMENT_COTOPOLOGIQUE(),volume(NULL),coque(mgcoq),mince(false)
44 {
45 }
46
47
48 MG_COQUILLE::MG_COQUILLE(MG_COQUILLE& mdd):MG_ELEMENT_COTOPOLOGIQUE(),volume(mdd.volume),lst_coface(mdd.lst_coface),coque(mdd.coque),mince(mdd.mince)
49 {
50 }
51
52
53 MG_COQUILLE::~MG_COQUILLE()
54 {
55 }
56
57
58 void MG_COQUILLE::ajouter_mg_coface(class MG_COFACE* mgcoface)
59 {
60 lst_coface.insert(lst_coface.end(),mgcoface);
61 }
62
63 int MG_COQUILLE::get_nb_mg_coface(void)
64 {
65 return lst_coface.size();
66 }
67
68 MG_VOLUME* MG_COQUILLE::get_mg_volume(void)
69 {
70 return volume;
71 }
72
73 MG_COQUE* MG_COQUILLE::get_mg_coque(void)
74 {
75 return coque;
76 }
77 MG_COFACE* MG_COQUILLE::get_mg_coface(int num)
78 {
79 return lst_coface[num];
80 }
81
82 MG_COFACE* MG_COQUILLE::get_mg_cofaceid(int num)
83 {
84 for (std::vector<MG_COFACE*>::iterator it=lst_coface.begin();it!=lst_coface.end();it++)
85 if ((*it)->get_id()==num) return *it;
86 return NULL;
87
88 }
89
90 void MG_COQUILLE::supprimer_mg_coface(class MG_COFACE* mgcoface)
91 {
92 std::vector<MG_COFACE*>::iterator i;
93 for (i=lst_coface.begin();i!=lst_coface.end();i++)
94 {
95 if ((*i)==mgcoface)
96 {
97 lst_coface.erase(i);
98 return;
99 }
100 }
101 }
102
103
104 void MG_COQUILLE::enregistrer(std::ostream& o,double version)
105 {
106 if (volume!=NULL)
107 {
108 if (!mince) o << "%" << get_id() << "=COQUILLE($"<< volume->get_id() << ",(";
109 else o << "%" << get_id() << "=COQUILLE_MINCE($"<< volume->get_id() << ",(";
110 }
111 if (coque!=NULL) o << "%" << get_id() << "=COQUILLE($"<< coque->get_id() << ",(";
112 for (unsigned int i=0;i<lst_coface.size();i++)
113 {
114 o << "$" << lst_coface[i]->get_id();
115 if (i!=lst_coface.size()-1) o << ",";
116 else o << ")";
117 }
118 if (mince)
119 {
120 o << ",(" ;
121 for (int i=0;i<get_nb_face_correspondante()-1;i++)
122 o << "$" << lst_base[i]->get_id() << "," << "$" << lst_extrude[i]->get_id() << "," ;
123 o << "$" << lst_base[get_nb_face_correspondante()-1]->get_id() << "," << "$" << lst_extrude[get_nb_face_correspondante()-1]->get_id();
124 o << ")" ;
125 }
126 o << ");" << std::endl;
127 }
128
129
130
131 void MG_COQUILLE::ajouter_face_correspondante(MG_COFACE* face1,MG_COFACE* face2)
132 {
133 lst_base.push_back(face1);
134 lst_extrude.push_back(face2);
135 mince=true;
136 }
137
138 void MG_COQUILLE::get_face_correspondante(int num,MG_COFACE** face1,MG_COFACE** face2)
139 {
140 (*face1)=lst_base[num];
141 (*face2)=lst_extrude[num];
142 }
143
144 int MG_COQUILLE::get_nb_face_correspondante(void)
145 {
146 return lst_base.size();
147 }
148
149 bool MG_COQUILLE::est_mince(void)
150 {
151 return mince;
152 }