| 1 |
/*****************************************************************
|
| 2 |
|
| 3 |
r3d_comp_vertex.c Type:Func
|
| 4 |
|
| 5 |
comparaison des vertex d une octree
|
| 6 |
|
| 7 |
Date de creation : Tue Jul 22 16:06:48 1997
|
| 8 |
|
| 9 |
Derniere version : Tue Jul 22 16:06:48 1997
|
| 10 |
|
| 11 |
|
| 12 |
Vincent FRANCOIS
|
| 13 |
|
| 14 |
*****************************************************************/
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
/**************************/
|
| 21 |
/* include */
|
| 22 |
#include <stdio.h>
|
| 23 |
#include <string.h>
|
| 24 |
#include <math.h>
|
| 25 |
#include "const.h"
|
| 26 |
#include "memoire.h"
|
| 27 |
#include "struct.h"
|
| 28 |
#include "prototype.h"
|
| 29 |
|
| 30 |
/**************************/
|
| 31 |
/* variables globales */
|
| 32 |
extern struct s_acis *acis;
|
| 33 |
extern struct environnement env;
|
| 34 |
extern struct s_mesh *mesh;
|
| 35 |
extern struct s_param *para;
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
/**************************/
|
| 40 |
/* programme principal */
|
| 41 |
|
| 42 |
void r3d_comp_vertex(struct s_octree *oct,int nb_vertex,float dens)
|
| 43 |
{
|
| 44 |
int i,nb_entite,ok,j,k,num;
|
| 45 |
char mess[255],type[20];
|
| 46 |
struct s_vertex *vertex;
|
| 47 |
struct s_point *point;
|
| 48 |
float x,y,z;
|
| 49 |
struct r_vertex l_vertex[20];
|
| 50 |
int l_edge[2];
|
| 51 |
|
| 52 |
nb_entite=0;
|
| 53 |
for (i=0;i<oct->nb_vertex;i++)
|
| 54 |
{
|
| 55 |
vertex=oct->vertex[i];
|
| 56 |
point=vertex->point;
|
| 57 |
l_vertex[nb_entite].x=point->coord[0];
|
| 58 |
l_vertex[nb_entite].y=point->coord[1];
|
| 59 |
l_vertex[nb_entite].z=point->coord[2];
|
| 60 |
l_vertex[nb_entite].num=vertex->num;
|
| 61 |
l_vertex[nb_entite].gtrouve=0;
|
| 62 |
nb_entite++;
|
| 63 |
}
|
| 64 |
for (j=0;j<nb_vertex;j++)
|
| 65 |
{
|
| 66 |
r3d_file(mess);
|
| 67 |
sscanf(mess,"%s %d %f %f %f",type,&num,&x,&y,&z);
|
| 68 |
ok=0;
|
| 69 |
for (k=0;k<nb_entite;k++)
|
| 70 |
{
|
| 71 |
if (EGAL(l_vertex[k].x,x,0.0001))
|
| 72 |
if (EGAL(l_vertex[k].y,y,0.0001))
|
| 73 |
if (EGAL(l_vertex[k].z,z,0.0001))
|
| 74 |
{
|
| 75 |
ok=1;
|
| 76 |
l_vertex[k].gtrouve=1;
|
| 77 |
}
|
| 78 |
}
|
| 79 |
if (ok==0)
|
| 80 |
r3d_zone(ORIGINAL,OLD,oct,dens,VERTEX,num,0,l_edge);
|
| 81 |
}
|
| 82 |
for (k=0;k<nb_entite;k++)
|
| 83 |
if (l_vertex[k].gtrouve==0)
|
| 84 |
r3d_zone(RETARDE1,NEW,oct,dens,VERTEX,l_vertex[k].num,0,l_edge);
|
| 85 |
return;
|
| 86 |
}
|