ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_noeud.cpp
Revision: 35
Committed: Thu Aug 16 21:24:14 2007 UTC (17 years, 9 months ago) by francois
Original Path: magic/lib/geometrie/geometrie/src/mg_noeud.cpp
File size: 5327 byte(s)
Log Message:
Mailleur 3D + divers bugs + origine des elements de maillages

File Contents

# User Rev Content
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_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     #include "ot_boite_2D.h"
30     #include "mg_maillage.h"
31    
32    
33    
34    
35 francois 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 5 {
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 francois 35 MG_NOEUD::MG_NOEUD(MG_ELEMENT_TOPOLOGIQUE* topo,double xx,double yy,double zz,int origine):MG_ELEMENT_MAILLAGE(topo,origine)
45 5 {
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 francois 35 MG_NOEUD* noeud=new MG_NOEUD(this->get_id()+decalage,liaison_topologique,xyz[0],xyz[1],xyz[2],DUPLIQUER);
65 5 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     void MG_NOEUD::change_u(double uu)
106     {
107     u=uu;
108     }
109    
110     void MG_NOEUD::change_v(double vv)
111     {
112     v=vv;
113     }
114    
115     double MG_NOEUD::get_u(void)
116     {
117     return u;
118     }
119    
120     double MG_NOEUD::get_v(void)
121     {
122     return v;
123     }
124    
125     void MG_NOEUD::change_x(double xx)
126     {
127     xyz[0]=xx;
128     }
129    
130     void MG_NOEUD::change_y(double yy)
131     {
132     xyz[1]=yy;
133     }
134    
135     void MG_NOEUD::change_z(double zz)
136     {
137     xyz[2]=zz;
138     }
139    
140     void MG_NOEUD::change_coord(double *coo)
141     {
142     xyz[0]=coo[0];
143     xyz[1]=coo[1];
144     xyz[2]=coo[2];
145     }
146    
147     void MG_NOEUD::change_solution(double val)
148     {
149     solution=val;
150     }
151    
152     double MG_NOEUD::get_solution(void)
153     {
154     return solution;
155     }
156    
157    
158     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_segment(void)
159     {
160     return &segment;
161     }
162    
163    
164     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_petit_segment(void)
165     {
166     return &petit_segment;
167     }
168    
169    
170     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_triangle(void)
171     {
172     return &triangle;
173     }
174    
175    
176     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_petit_triangle(void)
177     {
178     return &petit_triangle;
179     }
180    
181     TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_tetra(void)
182     {
183     return &tetra;
184     }
185    
186    
187     TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_petit_tetra(void)
188     {
189     return &petit_tetra;
190     }
191    
192    
193    
194     int MG_NOEUD::get_dimension(void)
195     {
196     return 0;
197     }
198    
199    
200    
201    
202     BOITE_2D MG_NOEUD::get_boite_2D(double periodeu,double periodev)
203     {
204     BOITE_2D boite(u,v,u,v);
205     return boite;
206    
207     }
208    
209     BOITE_3D MG_NOEUD::get_boite_3D(void)
210     {
211     BOITE_3D boite(xyz[0],xyz[1],xyz[2],xyz[0],xyz[1],xyz[2]);
212     return boite;
213    
214     }
215    
216     void MG_NOEUD::enregistrer(std::ostream& o)
217     {
218 francois 35 if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=NOEUD($"<< get_lien_topologie()->get_id() << "," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << origine_creation << ");" << std::endl;
219     else o << "%" << get_id() << "=NOEUD(NULL," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << origine_creation <<");" << std::endl;
220 5
221     }
222