ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mtu/src/mg_noeud.cpp
Revision: 1158
Committed: Thu Jun 13 22:18:49 2024 UTC (11 months, 1 week ago) by francois
File size: 5613 byte(s)
Log Message:
compatibilité Ubuntu 22.04
Suppression des refeences à Windows
Ajout d'une banière

File Contents

# User Rev Content
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     //####// mg_noeud.cpp
15     //####//
16     //####//------------------------------------------------------------
17     //####//------------------------------------------------------------
18     //####// COPYRIGHT 2000-2024
19     //####// jeu 13 jun 2024 11:58:53 EDT
20     //####//------------------------------------------------------------
21     //####//------------------------------------------------------------
22 francois 283
23    
24     #include "gestionversion.h"
25     #include "mg_noeud.h"
26 francois 481 #include "ot_boite_2d.h"
27 francois 283 #include "mg_maillage.h"
28    
29    
30    
31    
32     MG_NOEUD::MG_NOEUD(unsigned long num,MG_ELEMENT_TOPOLOGIQUE* topo,double xx,double yy,double zz,int origine):MG_ELEMENT_MAILLAGE(num,topo,origine)
33     {
34     xyz[0]=xx;
35     xyz[1]=yy;
36     xyz[2]=zz;
37     if (topo==NULL) return;
38     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->ajouter(this);
39     }
40    
41     MG_NOEUD::MG_NOEUD(MG_ELEMENT_TOPOLOGIQUE* topo,double xx,double yy,double zz,int origine):MG_ELEMENT_MAILLAGE(topo,origine)
42     {
43     xyz[0]=xx;
44     xyz[1]=yy;
45     xyz[2]=zz;
46     if (topo==NULL) return;
47     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->ajouter(this);
48     }
49    
50     MG_NOEUD::MG_NOEUD(MG_NOEUD& mdd):MG_ELEMENT_MAILLAGE(mdd)
51     {
52     xyz[0]=mdd.xyz[0];
53     xyz[1]=mdd.xyz[1];
54     xyz[2]=mdd.xyz[2];
55     if (mdd.get_lien_topologie()==NULL) return;
56     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->ajouter(this);
57     }
58    
59     MG_NOEUD* MG_NOEUD::dupliquer(MG_MAILLAGE *mgmai,long decalage)
60     {
61 francois 791 MG_NOEUD* noeud=new MG_NOEUD(this->get_id()+decalage,liaison_topologique,xyz[0],xyz[1],xyz[2],MAGIC::ORIGINE::DUPLIQUER);
62 francois 283 mgmai->ajouter_mg_noeud(noeud);
63     return noeud;
64     }
65    
66     MG_NOEUD::~MG_NOEUD()
67     {
68     if (liaison_topologique==NULL) return;
69     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->supprimer(this);
70     }
71    
72     int MG_NOEUD::get_type_entite(void)
73     {
74 francois 1150 return MAGIC::TYPE_ENTITE::IDMG_NOEUD;
75 francois 283 }
76    
77     double MG_NOEUD::get_x(void)
78     {
79     return xyz[0];
80     }
81    
82     double MG_NOEUD::get_y(void)
83     {
84     return xyz[1];
85     }
86    
87     double MG_NOEUD::get_z(void)
88     {
89     return xyz[2];
90     }
91    
92     double* MG_NOEUD::get_coord(void)
93     {
94     return xyz;
95     }
96 gervaislavoie 332
97    
98 francois 283 void MG_NOEUD::change_u(double uu)
99     {
100     u=uu;
101     }
102    
103     void MG_NOEUD::change_v(double vv)
104     {
105     v=vv;
106     }
107    
108     double MG_NOEUD::get_u(void)
109     {
110     return u;
111     }
112    
113     double MG_NOEUD::get_v(void)
114     {
115     return v;
116     }
117    
118     void MG_NOEUD::change_x(double xx)
119     {
120     xyz[0]=xx;
121     }
122    
123     void MG_NOEUD::change_y(double yy)
124     {
125     xyz[1]=yy;
126     }
127    
128     void MG_NOEUD::change_z(double zz)
129     {
130     xyz[2]=zz;
131     }
132    
133     void MG_NOEUD::change_coord(double *coo)
134     {
135     xyz[0]=coo[0];
136     xyz[1]=coo[1];
137     xyz[2]=coo[2];
138     }
139    
140    
141     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_segment(void)
142     {
143     return &segment;
144     }
145    
146    
147     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_petit_segment(void)
148     {
149     return &petit_segment;
150     }
151    
152    
153     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_triangle(void)
154     {
155     return &triangle;
156     }
157    
158    
159     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_petit_triangle(void)
160     {
161     return &petit_triangle;
162     }
163    
164 francois 308 TPL_LISTE_ENTITE<class MG_QUADRANGLE*>* MG_NOEUD::get_lien_quadrangle(void)
165     {
166     return &quadrangle;
167     }
168    
169    
170     TPL_LISTE_ENTITE<class MG_QUADRANGLE*>* MG_NOEUD::get_lien_petit_quadrangle(void)
171     {
172     return &petit_quadrangle;
173     }
174    
175 francois 283 TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_tetra(void)
176     {
177     return &tetra;
178     }
179    
180    
181     TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_petit_tetra(void)
182     {
183     return &petit_tetra;
184     }
185    
186 francois 308 TPL_LISTE_ENTITE<class MG_HEXA*>* MG_NOEUD::get_lien_hexa(void)
187     {
188     return &hexa;
189     }
190 francois 283
191    
192 francois 308 TPL_LISTE_ENTITE<class MG_HEXA*>* MG_NOEUD::get_lien_petit_hexa(void)
193     {
194     return &petit_hexa;
195     }
196    
197 francois 876 TPL_LISTE_ENTITE<class MG_PENTA*>* MG_NOEUD::get_lien_penta(void)
198     {
199     return &penta;
200     }
201 francois 308
202    
203 francois 876 TPL_LISTE_ENTITE<class MG_PENTA*>* MG_NOEUD::get_lien_petit_penta(void)
204     {
205     return &petit_penta;
206     }
207    
208 francois 1123 TPL_LISTE_ENTITE<class MG_PYRAMIDE*>* MG_NOEUD::get_lien_pyramide(void)
209     {
210     return &pyramide;
211     }
212 francois 876
213    
214 francois 1123 TPL_LISTE_ENTITE<class MG_PYRAMIDE*>* MG_NOEUD::get_lien_petit_pyramide(void)
215     {
216     return &petit_pyramide;
217     }
218    
219 francois 283 int MG_NOEUD::get_dimension(void)
220     {
221     return 0;
222     }
223    
224    
225    
226    
227     BOITE_2D MG_NOEUD::get_boite_2D(double periodeu,double periodev)
228     {
229     BOITE_2D boite(u,v,u,v);
230     return boite;
231    
232     }
233    
234     BOITE_3D MG_NOEUD::get_boite_3D(void)
235     {
236     BOITE_3D boite(xyz[0],xyz[1],xyz[2],xyz[0],xyz[1],xyz[2]);
237     return boite;
238    
239     }
240    
241 francois 763 void MG_NOEUD::enregistrer(std::ostream& o,double version)
242 francois 283 {
243     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=NOEUD($"<< get_lien_topologie()->get_id() << "," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << origine_creation << ");" << std::endl;
244     else o << "%" << get_id() << "=NOEUD(NULL," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << origine_creation <<");" << std::endl;
245    
246     }
247    
248 francois 1142 bool MG_NOEUD::operator==(const MG_NOEUD& mdd) const
249     {
250     if (xyz[0]==mdd.xyz[0])
251     if (xyz[1]==mdd.xyz[1])
252     if (xyz[2]==mdd.xyz[2])
253     return true;
254     return false;
255     }