ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mailleur/src/dly_noeud.cpp
Revision: 360
Committed: Wed Oct 3 14:59:20 2012 UTC (12 years, 7 months ago) by francois
File size: 4101 byte(s)
Log Message:
Bug resolu dans dly_noeud

File Contents

# User Rev Content
1 francois 285 //------------------------------------------------------------
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     // m3d_noeud.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20     // Version du 02/03/2006 � 11H23
21     //------------------------------------------------------------
22     //------------------------------------------------------------
23    
24    
25     #include "gestionversion.h"
26    
27     //#pragma hdrstop
28    
29     #include "dly_noeud.h"
30     //---------------------------------------------------------------------------
31    
32     //#pragma package(smart_init)
33    
34     #include <stdlib.h>
35     #include "dly_triangle.h"
36     #include "dly_segment.h"
37    
38    
39    
40     DLY_NOEUD::DLY_NOEUD(int n,double xx,double yy,double zz):noeud(NULL),num(n)
41     {
42     xyz[0]=xx;
43     xyz[1]=yy;
44     xyz[2]=zz;
45     }
46 francois 360 DLY_NOEUD::DLY_NOEUD(int n,double *xyztmp):num(n),noeud(NULL)
47 francois 285 {
48     xyz[0]=xyztmp[0];
49     xyz[1]=xyztmp[1];
50     xyz[2]=xyztmp[2];
51     }
52    
53 francois 360 DLY_NOEUD::DLY_NOEUD(DLY_NOEUD& mdd):num(mdd.num),noeud(mdd.noeud)
54 francois 285 {
55     xyz[0]=mdd.xyz[0];
56     xyz[1]=mdd.xyz[1];
57     xyz[2]=mdd.xyz[2];
58     }
59    
60     DLY_NOEUD::~DLY_NOEUD()
61     {
62     }
63    
64     double DLY_NOEUD::get_x(void)
65     {
66     return xyz[0];
67     }
68     double DLY_NOEUD::get_y(void)
69     {
70     return xyz[1];
71     }
72     double DLY_NOEUD::get_z(void)
73     {
74     return xyz[2];
75     }
76    
77     void DLY_NOEUD::change_x(double val)
78     {
79     xyz[0]=val;
80     }
81     void DLY_NOEUD::change_y(double val)
82     {
83     xyz[1]=val;
84     }
85     void DLY_NOEUD::change_z(double val)
86     {
87     xyz[2]=val;
88     }
89     void DLY_NOEUD::get_coord(double *xyztmp)
90     {
91     xyztmp[0]=xyz[0];
92     xyztmp[1]=xyz[1];
93     xyztmp[2]=xyz[2];
94     }
95     MG_NOEUD* DLY_NOEUD::get_noeud(void)
96     {
97     return noeud;
98     }
99    
100     void DLY_NOEUD::change_noeud(MG_NOEUD* no)
101     {
102     noeud=no;
103     }
104     int DLY_NOEUD::get_num(void)
105     {
106     return num;
107     }
108    
109    
110     void DLY_NOEUD::insere_lien_segment(class DLY_SEGMENT* seg)
111     {
112     petit_lien_seg.push_back(seg);
113     }
114    
115     int DLY_NOEUD::get_lien_segment(class DLY_SEGMENT* seg)
116     {
117     for (std::vector<DLY_SEGMENT*>::iterator it=petit_lien_seg.begin();it!=petit_lien_seg.end();it++)
118     if ((*it)==seg) return 1;
119     return 0;
120     }
121     DLY_SEGMENT* DLY_NOEUD::get_lien_segment(class DLY_NOEUD* n1,class DLY_NOEUD* n2)
122     {
123     for (std::vector<DLY_SEGMENT*>::iterator it=petit_lien_seg.begin();it!=petit_lien_seg.end();it++)
124     {
125     DLY_SEGMENT* seg=(*it);
126     if ((n1==seg->get_noeud1()) || (n1==seg->get_noeud2()))
127     if ((n2==seg->get_noeud1()) || (n2==seg->get_noeud2()))
128     return seg;
129     }
130     return NULL;
131     }
132    
133    
134     void DLY_NOEUD::insere_lien_triangle(class DLY_TRIANGLE* tri)
135     {
136     petit_lien_tri.push_back(tri);
137     }
138    
139     int DLY_NOEUD::get_lien_triangle(class DLY_TRIANGLE* tri)
140     {
141     for (std::vector<DLY_TRIANGLE*>::iterator it=petit_lien_tri.begin();it!=petit_lien_tri.end();it++)
142     if ((*it)==tri) return 1;
143     return 0;
144     }
145    
146     DLY_TRIANGLE* DLY_NOEUD::get_lien_triangle(class DLY_NOEUD* n1,class DLY_NOEUD* n2,class DLY_NOEUD* n3)
147     {
148     for (std::vector<DLY_TRIANGLE*>::iterator it=petit_lien_tri.begin();it!=petit_lien_tri.end();it++)
149     {
150     DLY_TRIANGLE* tri=(*it);
151     if ((n1==tri->get_noeud1()) || (n1==tri->get_noeud2()) ||(n1==tri->get_noeud3()))
152     if ((n2==tri->get_noeud1()) || (n2==tri->get_noeud2()) ||(n2==tri->get_noeud3()))
153     if ((n3==tri->get_noeud1()) || (n3==tri->get_noeud2()) ||(n3==tri->get_noeud3()))
154     return tri;
155     }
156     return NULL;
157     }