ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_noeud.cpp
Revision: 253
Committed: Tue Jul 13 19:40:46 2010 UTC (14 years, 10 months ago) by francois
File size: 5227 byte(s)
Log Message:
changement de hiearchie et utilisation de ccmake + mise a jour

File Contents

# User Rev Content
1 5 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4 francois 174 // Jean Christophe Cuilli�re et Vincent FRANCOIS
5     // D�partement de G�nie M�canique - UQTR
6 5 //------------------------------------------------------------
7 francois 174 // 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 5 // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // mg_noeud.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20 francois 174 // Version du 02/03/2006 � 11H22
21 5 //------------------------------------------------------------
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    
148    
149     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_segment(void)
150     {
151     return &segment;
152     }
153    
154    
155     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_petit_segment(void)
156     {
157     return &petit_segment;
158     }
159    
160    
161     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_triangle(void)
162     {
163     return &triangle;
164     }
165    
166    
167     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_petit_triangle(void)
168     {
169     return &petit_triangle;
170     }
171    
172     TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_tetra(void)
173     {
174     return &tetra;
175     }
176    
177    
178     TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_petit_tetra(void)
179     {
180     return &petit_tetra;
181     }
182    
183    
184    
185     int MG_NOEUD::get_dimension(void)
186     {
187     return 0;
188     }
189    
190    
191    
192    
193     BOITE_2D MG_NOEUD::get_boite_2D(double periodeu,double periodev)
194     {
195     BOITE_2D boite(u,v,u,v);
196     return boite;
197    
198     }
199    
200     BOITE_3D MG_NOEUD::get_boite_3D(void)
201     {
202     BOITE_3D boite(xyz[0],xyz[1],xyz[2],xyz[0],xyz[1],xyz[2]);
203     return boite;
204    
205     }
206    
207     void MG_NOEUD::enregistrer(std::ostream& o)
208     {
209 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;
210     else o << "%" << get_id() << "=NOEUD(NULL," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << origine_creation <<");" << std::endl;
211 5
212     }
213