1 |
/*****************************************************************
|
2 |
|
3 |
r3d_ins_face.cpp Type:Func
|
4 |
|
5 |
Insertion des faces de chaque tetraedres
|
6 |
|
7 |
Date de creation : 4-9-1997 11 :29 :45
|
8 |
Derniere version : 4-9-1997 11 :29 :45
|
9 |
|
10 |
Vincent FRANCOIS
|
11 |
|
12 |
*****************************************************************/
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
/**************************/
|
19 |
/* include */
|
20 |
#include <stdio.h>
|
21 |
#include <stdlib.h>
|
22 |
#include <math.h>
|
23 |
#include "const.h"
|
24 |
#include "memoire.h"
|
25 |
#include "struct.h"
|
26 |
#include "prototype.h"
|
27 |
|
28 |
|
29 |
/**************************/
|
30 |
/* variables globales */
|
31 |
extern struct environnement env;
|
32 |
extern struct s_mesh *mesh;
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
/**************************/
|
38 |
/* programme principal */
|
39 |
|
40 |
void r3d_ins_face(int n1,int n2,int n3)
|
41 |
{
|
42 |
struct s_noeud *no;
|
43 |
struct s_triangle *tri;
|
44 |
int i,num;
|
45 |
|
46 |
no=ADRESSE(n1,noeud,mesh->);
|
47 |
for (i=0;i<no->nb_triangle;i++)
|
48 |
{
|
49 |
tri=no->triangle[i];
|
50 |
if ( (tri->n1==n1) || (tri->n1==n2) || (tri->n1==n3) )
|
51 |
if ( (tri->n2==n1) || (tri->n2==n2) || (tri->n2==n3) )
|
52 |
if ( (tri->n3==n1) || (tri->n3==n2) || (tri->n3==n3) )
|
53 |
{
|
54 |
tri->front++;
|
55 |
return;
|
56 |
}
|
57 |
}
|
58 |
NEW_ENTITE(tri,triangle,mesh->);
|
59 |
tri->num=mesh->nb_triangle-1;
|
60 |
tri->n1=n1;
|
61 |
tri->n2=n2;
|
62 |
tri->n3=n3;
|
63 |
tri->front=1;
|
64 |
no=ADRESSE(tri->n1,noeud,mesh->);
|
65 |
NEW_POINTEUR(num,triangle,no->);
|
66 |
no->triangle[num]=tri;
|
67 |
no=ADRESSE(tri->n2,noeud,mesh->);
|
68 |
NEW_POINTEUR(num,triangle,no->);
|
69 |
no->triangle[num]=tri;
|
70 |
no=ADRESSE(tri->n3,noeud,mesh->);
|
71 |
NEW_POINTEUR(num,triangle,no->);
|
72 |
no->triangle[num]=tri;
|
73 |
}
|