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