MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
dly_triangle.cpp
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
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_triangle.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:55 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 
24 #include "gestionversion.h"
25 #include <stdlib.h>
26 
27 #include "dly_noeud.h"
28 #include "dly_triangle.h"
29 #include "dly_tetra.h"
30 #include "ot_mathematique.h"
31 #include <math.h>
32 
33 
34 
35 DLY_TRIANGLE::DLY_TRIANGLE(class DLY_NOEUD *no1,class DLY_NOEUD *no2,class DLY_NOEUD *no3):noeud1(no1),noeud2(no2),noeud3(no3),frontiere(-1)
36 {
37 }
38 DLY_TRIANGLE::DLY_TRIANGLE(DLY_TRIANGLE& mdd):noeud1(mdd.noeud1),noeud2(mdd.noeud2),noeud3(mdd.noeud3),frontiere(mdd.frontiere)
39 {
40 }
42 {
43 }
44 
46 {
47 return noeud1;
48 }
50 {
51 return noeud2;
52 }
54 {
55 return noeud3;
56 }
57 
59 {
60 lsttet.push_back(tet);
61 }
62 
63 
65 {
66 for (std::vector<DLY_TETRA*>::iterator it=lsttet.begin();it!=lsttet.end();it++)
67  if ((*it)==tet) return 1;return 0;
68 }
69 
71 {
72 return lsttet.size();
73 }
74 
76 {
77 return lsttet[i];
78 }
79 
80 int DLY_TRIANGLE::est_coplanaire(double x,double y, double z)
81 {
82 double xyz1[3],xyz2[3],xyz3[3];
83 noeud1->get_coord(xyz1);
84 noeud2->get_coord(xyz2);
85 noeud3->get_coord(xyz3);
86 double xyz[3]={x,y,z};
87 OT_VECTEUR_3D vec1(xyz1,xyz2);
88 OT_VECTEUR_3D vec2(xyz1,xyz3);
89 OT_VECTEUR_3D n=vec1&vec2;
90 OT_VECTEUR_3D vec(xyz1,xyz);
91 n.norme();
92 vec.norme();
93 double ps=n*vec;
94 int resultat=0;
95 if (fabs(ps)<0.0000000001) resultat=1;
96 return resultat;
97 }
98 
100 {
101 if (frontiere==-1)
102  {
103  int nbtetra=0;
104  for (int j=0;j<lsttet.size();j++)
105  if ((lsttet[j])->get_feuille()==1) nbtetra++;
106  if (nbtetra==1) frontiere=1; else frontiere=0;
107  }
108 return frontiere;
109 }
DLY_TRIANGLE::noeud3
DLY_NOEUD * noeud3
Definition: dly_triangle.h:52
DLY_TRIANGLE::get_tetra
DLY_TETRA * get_tetra(int i)
Definition: dly_triangle.cpp:75
dly_tetra.h
DLY_TRIANGLE::get_noeud1
DLY_NOEUD * get_noeud1(void)
Definition: dly_triangle.cpp:45
gestionversion.h
DLY_TRIANGLE::insere_lien_tetra
void insere_lien_tetra(class DLY_TETRA *tet)
Definition: dly_triangle.cpp:58
DLY_NOEUD
Definition: dly_noeud.h:30
DLY_TRIANGLE::get_noeud3
DLY_NOEUD * get_noeud3(void)
Definition: dly_triangle.cpp:53
DLY_TRIANGLE::DLY_TRIANGLE
DLY_TRIANGLE(class DLY_NOEUD *no1, class DLY_NOEUD *no2, class DLY_NOEUD *no3)
Definition: dly_triangle.cpp:35
DLY_TRIANGLE::est_frontiere
int est_frontiere(void)
Definition: dly_triangle.cpp:99
DLY_SEGMENT::noeud1
DLY_NOEUD * noeud1
Definition: dly_segment.h:52
DLY_TRIANGLE::frontiere
int frontiere
Definition: dly_triangle.h:54
DLY_NOEUD::get_coord
virtual void get_coord(double *xyztmp)
Definition: dly_noeud.cpp:85
dly_triangle.h
DLY_SEGMENT::noeud2
DLY_NOEUD * noeud2
Definition: dly_segment.h:53
DLY_TRIANGLE
Definition: dly_triangle.h:30
OT_VECTEUR_3D::norme
virtual void norme(void)
Definition: ot_mathematique.cpp:494
DLY_TRIANGLE::est_coplanaire
int est_coplanaire(double x, double y, double z)
Definition: dly_triangle.cpp:80
DLY_TRIANGLE::tet_est_present
int tet_est_present(DLY_TETRA *tet)
Definition: dly_triangle.cpp:64
ot_mathematique.h
DLY_TRIANGLE::noeud2
DLY_NOEUD * noeud2
Definition: dly_triangle.h:51
OT_VECTEUR_3D
Definition: ot_mathematique.h:94
DLY_TRIANGLE::lsttet
std::vector< class DLY_TETRA * > lsttet
Definition: dly_triangle.h:53
DLY_TRIANGLE::get_nb_tetra
int get_nb_tetra(void)
Definition: dly_triangle.cpp:70
dly_noeud.h
DLY_TETRA
Definition: dly_tetra.h:30
DLY_TRIANGLE::~DLY_TRIANGLE
virtual ~DLY_TRIANGLE()
Definition: dly_triangle.cpp:41
DLY_TRIANGLE::get_noeud2
DLY_NOEUD * get_noeud2(void)
Definition: dly_triangle.cpp:49
DLY_TRIANGLE::noeud1
DLY_NOEUD * noeud1
Definition: dly_triangle.h:50