1 |
|
5 |
#include <stdio.h>
|
2 |
|
|
#include "m3d_struct.h"
|
3 |
|
|
#include "m3d_const.h"
|
4 |
|
|
#include "m3d_hotes.h"
|
5 |
|
|
#include "m3d_erreur.h"
|
6 |
|
|
#include "prototype.h"
|
7 |
|
|
extern int debug;
|
8 |
|
|
extern GEST_MEM *gest ;
|
9 |
|
|
int m3d_check(void)
|
10 |
|
|
{
|
11 |
|
|
TETRAEDRE *tetra ;
|
12 |
|
|
char mess[255];
|
13 |
|
|
int i, card ;
|
14 |
|
|
FACE *face ;
|
15 |
|
|
for (i=0;i<gest->nb_face;i++)
|
16 |
|
|
{
|
17 |
|
|
/* adresse de la face de numero i */
|
18 |
|
|
card = 0 ;
|
19 |
|
|
ADRESSE(face,i,face)
|
20 |
|
|
if (face->mark != DESTROYED)
|
21 |
|
|
{
|
22 |
|
|
if (face->hist == 0) /* face de la peau */
|
23 |
|
|
{
|
24 |
|
|
if (face->tetra1 != NULL)
|
25 |
|
|
if (face->tetra1->mark != KILLED) card ++ ;
|
26 |
|
|
if (face->tetra2 != NULL)
|
27 |
|
|
if (face->tetra2->mark != KILLED) card ++ ;
|
28 |
|
|
if (card != 1)
|
29 |
|
|
{
|
30 |
|
|
if (debug)
|
31 |
|
|
{
|
32 |
|
|
sprintf("%s\n","MAILLAGE NON CONFORME ") ;
|
33 |
|
|
//aff_text(mess);
|
34 |
|
|
}
|
35 |
|
|
m3d_erreur(ERR_SYST) ;
|
36 |
|
|
return(FAUX) ;
|
37 |
|
|
}
|
38 |
|
|
}
|
39 |
|
|
else
|
40 |
|
|
{
|
41 |
|
|
if (face->tetra1 != NULL)
|
42 |
|
|
if (face->tetra1->mark != KILLED) card ++ ;
|
43 |
|
|
if (face->tetra2 != NULL)
|
44 |
|
|
if (face->tetra2->mark != KILLED) card ++ ;
|
45 |
|
|
if (card != 2)
|
46 |
|
|
{
|
47 |
|
|
if (debug)
|
48 |
|
|
{
|
49 |
|
|
sprintf(mess,"%s%d\n","MAILLAGE NON CONFORME ") ;
|
50 |
|
|
//aff_text(mess);
|
51 |
|
|
}
|
52 |
|
|
m3d_erreur(ERR_SYST) ;
|
53 |
|
|
return(FAUX) ;
|
54 |
|
|
}
|
55 |
|
|
}
|
56 |
|
|
}
|
57 |
|
|
}
|
58 |
|
|
return(VRAI) ;
|
59 |
|
|
}
|