ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_noeud.cpp
Revision: 763
Committed: Wed Dec 2 19:55:53 2015 UTC (9 years, 5 months ago) by francois
File size: 5626 byte(s)
Log Message:
Le fichier MAGiC est maintenant versionné. LA version actuelle est 2.0. L'ancienne version est 1.0.
Tout est transparent pour l'utilisateur. Les vieilles versions sont lisibles mais les nouveaux enregistrements sont dans la version la plus récente.
Changement des conditions aux limites : ajout d'un parametre pour dire si la condition numerique est une valeur ou une formule ou un lien vers une autre entité magic.
Les parametres pour saisir sont maintenant -ccf -ccfi -ccff -ccft -ccfit -ccfft

File Contents

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