Subversion Repositories wimsdev

Rev

Rev 1024 | Rev 8076 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1024 Rev 7675
Line 31... Line 31...
31
int linecnt=-100000;
31
int linecnt=-100000;
32
int tranged=0;
32
int tranged=0;
33
double xscale=1,yscale=1,xstart=0,ystart=0;
33
double xscale=1,yscale=1,xstart=0,ystart=0;
34
double tstart=0,tend=1,tstep=100,plotjump=200;
34
double tstart=0,tend=1,tstep=100,plotjump=200;
35
double animstep=0;
35
double animstep=0;
36
double matrix[]={1,0,0,1};      /* transformation matrix */
36
double matrix[]={1,0,0,1}; /* transformation matrix */
37
int transform=0;                /* transformation indicator */
37
int transform=0;  /* transformation indicator */
38
double transx=0,transy=0;       /* translation vector */
38
double transx=0,transy=0; /* translation vector */
39
int lstep=4;
39
int lstep=4;
40
ev_variable vartab[MAX_VARS];
40
ev_variable vartab[MAX_VARS];
41
char varnamebuf[MAX_VARNAMEBUF], *varnameptr=varnamebuf;
41
char varnamebuf[MAX_VARNAMEBUF], *varnameptr=varnamebuf;
42
int varcnt;
42
int varcnt;
43
int vimg=0;                     /* 0: no vector image output.
43
int vimg=0; /* 0: no vector image output.
44
                                 * 1: DXF vector output. */
44
             * 1: DXF vector output. */
45
int vimg_enable=0;              /* 0: disable. 1: enable. */
45
int vimg_enable=0; /* 0: disable. 1: enable. */
46
int vimg_ready=0;
46
int vimg_ready=0;
47
FILE *vimgf=NULL;
47
FILE *vimgf=NULL;
48
double scale_buf[MAX_PARMS];
48
double scale_buf[MAX_PARMS];
49
/***** Les modifs a JC Fev 06 *****/
49
/***** Les modifs a JC Fev 06 *****/
50
/** les matrices suivantes sont initialisees par la commande setmatrix nummatrix,a11,a12,a21,a22 */
50
/** les matrices suivantes sont initialisees par la commande setmatrix nummatrix,a11,a12,a21,a22 */
Line 68... Line 68...
68
double matrix17[] = {1,0,0,1};
68
double matrix17[] = {1,0,0,1};
69
double matrix18[] = {1,0,0,1};
69
double matrix18[] = {1,0,0,1};
70
double matrix19[] = {1,0,0,1};
70
double matrix19[] = {1,0,0,1};
71
#define JC_NB_MATRICES 19
71
#define JC_NB_MATRICES 19
72
/* la matrice fixant le systeme de coordonnees "mathematiques" dans l'image */
72
/* la matrice fixant le systeme de coordonnees "mathematiques" dans l'image */
73
double *matrices_pavage[] ={ matrix,
73
double *matrices_pavage[] ={ matrix,
74
                                matrix01,matrix02,matrix03,matrix04,matrix05,matrix06,matrix07,matrix08,matrix09,
74
        matrix01,matrix02,matrix03,matrix04,matrix05,matrix06,matrix07,matrix08,matrix09,
75
                                matrix10,matrix11,matrix12,matrix13,matrix14,matrix15,matrix16,matrix17,matrix18,matrix19
75
        matrix10,matrix11,matrix12,matrix13,matrix14,matrix15,matrix16,matrix17,matrix18,matrix19
76
 
76
 
77
};
77
};
78
/** les vecteurs suivants sont initialises par la commande setvector numvector,u_1,u_2 */
78
/** les vecteurs suivants sont initialises par la commande setvector numvector,u_1,u_2 */
79
/** ils sont remis a zero par resetvector numvector */
79
/** ils sont remis a zero par resetvector numvector */
80
double vector[] = {0,0};
80
double vector[] = {0,0};
81
double vector01[] = {0,0};
81
double vector01[] = {0,0};
82
double vector02[] = {0,0};
82
double vector02[] = {0,0};
Line 96... Line 96...
96
double vector16[] = {0,0};
96
double vector16[] = {0,0};
97
double vector17[] = {0,0};
97
double vector17[] = {0,0};
98
double vector18[] = {0,0};
98
double vector18[] = {0,0};
99
double vector19[] = {0,0};
99
double vector19[] = {0,0};
100
 
100
 
101
double *vecteurs_pavage[] ={ vector,
101
double *vecteurs_pavage[] ={ vector,
102
                                vector01,vector02,vector03,vector04,vector05,vector06,vector07,vector08,vector09,
102
         vector01,vector02,vector03,vector04,vector05,vector06,vector07,vector08,vector09,
103
                                vector10,vector11,vector12,vector13,vector14,vector15,vector16,vector17,vector18,vector19
103
         vector10,vector11,vector12,vector13,vector14,vector15,vector16,vector17,vector18,vector19
104
};
104
};
105
 
105
 
106
/** les coordonnees du parallelograme de pavage = coordonnees "mathematiques" du parallelogramme contenant l'image a recopier **/
106
/** les coordonnees du parallelograme de pavage = coordonnees "mathematiques" du parallelogramme contenant l'image a recopier **/
107
/** on place ces coorodonnes avec setparallelogram xs,ys,xu,yu,xv,yu **/
107
/** on place ces coorodonnes avec setparallelogram xs,ys,xu,yu,xv,yu **/
108
/* xs,ys=coordonnees math du point 0,0,
108
/* xs,ys=coordonnees math du point 0,0,
109
 * xu,yu coordonnees math de l'horizontale
109
 * xu,yu coordonnees math de l'horizontale
110
 * xv,yv coordonnees math de la verticale
110
 * xv,yv coordonnees math de la verticale
111
 * ces coordonnees sont remises a leur valeur par defaut par resetparallelogram
111
 * ces coordonnees sont remises a leur valeur par defaut par resetparallelogram
112
 */
112
 */
113
/** TODO serait-ce un moyen de definir la brush ?? **/
113
/** TODO serait-ce un moyen de definir la brush ?? **/
114
double parallogram_fonda[]={0,0,100,0,0,100};
114
double parallogram_fonda[]={0,0,100,0,0,100};
115
 
115
 
116
/**** Fin modifs JC Fev 06 ******/
116
/**** Fin modifs JC Fev 06 ******/
117
 
117
 
118
        /* Write the image */
118
/* Write the image */
119
void output(void)
119
void output(void)
120
{
120
{
121
    FILE *out;
121
    FILE *out;
122
 
122
 
123
    if(!image) return;
123
    if(!image) return;
124
    if(imagefilename[0]) {
124
    if(imagefilename[0]) {
125
        out=fopen(imagefilename,"wb");
125
      out=fopen(imagefilename,"wb");
126
        if(out!=NULL) {gdImageGif(image,out); fclose(out); }
126
      if(out!=NULL) {gdImageGif(image,out); fclose(out); }
127
    }
127
    }
128
    else gdImageGif(image,stdout);
128
    else gdImageGif(image,stdout);
129
    saved=1;
129
    saved=1;
130
}
130
}
131
 
131
 
Line 138... Line 138...
138
void process(void)
138
void process(void)
139
{
139
{
140
    char buf[MAX_LINELEN+1];
140
    char buf[MAX_LINELEN+1];
141
    int c;
141
    int c;
142
    do {
142
    do {
143
        c=ggetline(buf); obj_main(buf);
143
      c=ggetline(buf); obj_main(buf);
144
    }
144
    }
145
    while(c!=EOF);
145
    while(c!=EOF);
146
}
146
}
147
 
147
 
148
int verify_tables(void) {
148
int verify_tables(void) {
Line 153... Line 153...
153
{
153
{
154
    error1=error; error2=error; error3=error;
154
    error1=error; error2=error; error3=error;
155
    substitute=substit;
155
    substitute=substit;
156
    ev_varcnt=&varcnt; ev_var=vartab;
156
    ev_varcnt=&varcnt; ev_var=vartab;
157
    if(argc==2 && strcasecmp(argv[1],"table")==0) {
157
    if(argc==2 && strcasecmp(argv[1],"table")==0) {
158
        if(verify_tables()) {
158
      if(verify_tables()) {
159
            printf("Table disorder.\n"); return 1;
159
          printf("Table disorder.\n"); return 1;
160
        }
160
      }
161
        printf("Table orders OK.\n"); return 0;
161
      printf("Table orders OK.\n"); return 0;
162
    }
162
    }
163
    vartab[0].name="animstep"; vartab[0].value=0;
163
    vartab[0].name="animstep"; vartab[0].value=0;
164
    varcnt=1;
164
    varcnt=1;
165
    if(argc>1) snprintf(imagefilename,sizeof(imagefilename),"%s",argv[1]);
165
    if(argc>1) snprintf(imagefilename,sizeof(imagefilename),"%s",argv[1]);
166
    else imagefilename[0]=0;
166
    else imagefilename[0]=0;