ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/acismesh/m2d_enreg.cpp
Revision: 1
Committed: Mon Jun 11 22:53:07 2007 UTC (17 years, 11 months ago)
File size: 2182 byte(s)
Log Message:

File Contents

# User Rev Content
1 1 /*****************************************************************
2    
3     m2d_enreg.c Type:Func
4    
5     Enregistrement du maillage surfacique
6    
7     Date de creation : Thu Mar 6 16:46:28 1997
8    
9     Derniere version : Tue Apr 22 12:08:43 1997
10    
11    
12    
13    
14    
15    
16     Vincent FRANCOIS
17    
18     *****************************************************************/
19    
20    
21    
22    
23    
24     /**************************/
25     /* include */
26     #include <stdio.h>
27     #include <string.h>
28     #include "const.h"
29     #include "struct.h"
30     #include "memoire.h"
31     #include "prototype.h"
32    
33    
34     /**************************/
35     /* variables globales */
36     extern struct s_mesh *mesh;
37     extern struct environnement env;
38    
39    
40    
41     /**************************/
42     /* programme principal */
43    
44     void m2d_enreg(void)
45     {
46     FILE *fic;
47     int i;
48     struct s_noeud *no;
49     struct s_triangle *tri;
50     char string[255];
51    
52     strcpy(string,env.fich);
53     string[strlen(string)-4]=0;
54     strcat(string,"_2D.mai");
55     fic=fopen(string,"wt");
56     fprintf(fic,"%d %d \n",mesh->nb_noeud,mesh->nb_triangle);
57     for (i=0;i<mesh->nb_noeud;i++)
58     {
59     no=ADRESSE(i,noeud,mesh->);
60     if (no->type==VERTEX) strcpy(string,"vertex");
61     if (no->type==EDGE) strcpy(string,"edge");
62     if (no->type==FACE) strcpy(string,"face");
63     fprintf(fic,"%d %f %f %f %s %d %f\n",i+1,no->x,no->y,no->z,string,no->num_ent,no->dens);
64     }
65     for (i=0;i<mesh->nb_triangle;i++)
66     {
67     tri=ADRESSE(i,triangle,mesh->);
68     if (tri->type==FACE) strcpy(string,"face");
69     fprintf(fic,"3 %d %d %d %s %d\n",tri->n1+1,tri->n2+1,tri->n3+1,string,tri->num_ent);
70     }
71     fclose(fic);
72     }