ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/acismesh/m3d_enreg2.cpp
Revision: 2
Committed: Tue Jun 12 01:28:38 2007 UTC (17 years, 11 months ago)
File size: 2167 byte(s)
Log Message:
test svn

File Contents

# User Rev Content
1 1 /*****************************************************************
2    
3     m3d_enreg2.c Type:Func
4    
5     Enregistrement du maillage volumique
6    
7     Date de creation : Fri Aug 1 11:10:21 1997
8    
9     Derniere version : Fri Aug 1 11:10:21 1997
10    
11    
12    
13    
14    
15    
16    
17     Vincent FRANCOIS
18    
19     *****************************************************************/
20    
21    
22    
23    
24    
25     /**************************/
26     /* include */
27 2 #include <string.h>
28 1 #include <stdio.h>
29     #include "const.h"
30     #include "struct.h"
31     #include "memoire.h"
32     #include "prototype.h"
33    
34    
35     /**************************/
36     /* variables globales */
37     extern struct s_maillage *maillage;
38     extern struct environnement env;
39    
40    
41    
42     /**************************/
43     /* programme principal */
44    
45     void m3d_enreg2(void)
46     {
47     FILE *fic;
48     int i,nb;
49     struct s_mnoeud *mno,*mno1,*mno2,*mno3,*mno4;
50     struct s_mtetra *mtet;
51     char string[255];
52    
53     nb=0;
54     for (i=0;i<maillage->nb_mtetra;i++)
55     {
56     mtet=ADRESSE(i,mtetra,maillage->);
57     mno1=ADRESSE(mtet->n1,mnoeud,maillage->);
58     mno2=ADRESSE(mtet->n2,mnoeud,maillage->);
59     mno3=ADRESSE(mtet->n3,mnoeud,maillage->);
60     mno4=ADRESSE(mtet->n4,mnoeud,maillage->);
61     if (mno1->etat!=DETRUIT)
62     if (mno2->etat!=DETRUIT)
63     if (mno3->etat!=DETRUIT)
64     if (mno4->etat!=DETRUIT)
65     nb++;
66     }
67     strcpy(string,env.fich);
68     string[strlen(string)-4]=0;
69     strcat(string,"b_3D.mai");
70     fic=fopen(string,"wt");
71     fprintf(fic,"%d %d \n",maillage->nb_mnoeud,nb);
72     for (i=0;i<maillage->nb_mnoeud;i++)
73     {
74     mno=ADRESSE(i,mnoeud,maillage->);
75     fprintf(fic,"%d %f %f %f\n",i+1,mno->x,mno->y,mno->z);
76     }
77     for (i=0;i<maillage->nb_mtetra;i++)
78     {
79     mtet=ADRESSE(i,mtetra,maillage->);
80     mno1=ADRESSE(mtet->n1,mnoeud,maillage->);
81     mno2=ADRESSE(mtet->n2,mnoeud,maillage->);
82     mno3=ADRESSE(mtet->n3,mnoeud,maillage->);
83     mno4=ADRESSE(mtet->n4,mnoeud,maillage->);
84     if (mno1->etat!=DETRUIT)
85     if (mno2->etat!=DETRUIT)
86     if (mno3->etat!=DETRUIT)
87     if (mno4->etat!=DETRUIT)
88     fprintf(fic,"4 %d %d %d %d\n",mtet->n1+1,mtet->n2+1,mtet->n3+1,mtet->n4+1);
89     }
90     fclose(fic);
91     }