Subversion Repositories wimsdev

Rev

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

Rev 7675 Rev 8076
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 */
-
 
37
int transform=0;  /* transformation indicator */
36
int transform=0;  /* transformation indicator */
38
double transx=0,transy=0; /* translation vector */
37
double transx=0,transy=0; /* translation vector */
39
int lstep=4;
38
int lstep=4;
40
ev_variable vartab[MAX_VARS];
39
ev_variable vartab[MAX_VARS];
41
char varnamebuf[MAX_VARNAMEBUF], *varnameptr=varnamebuf;
40
char varnamebuf[MAX_VARNAMEBUF], *varnameptr=varnamebuf;
Line 47... Line 46...
47
FILE *vimgf=NULL;
46
FILE *vimgf=NULL;
48
double scale_buf[MAX_PARMS];
47
double scale_buf[MAX_PARMS];
49
/***** Les modifs a JC Fev 06 *****/
48
/***** Les modifs a JC Fev 06 *****/
50
/** les matrices suivantes sont initialisees par la commande setmatrix nummatrix,a11,a12,a21,a22 */
49
/** les matrices suivantes sont initialisees par la commande setmatrix nummatrix,a11,a12,a21,a22 */
51
/** elles sont remises a l'unite par resetmatrix nummatrix */
50
/** elles sont remises a l'unite par resetmatrix nummatrix */
52
double matrix01[] = {1,0,0,1};
-
 
53
double matrix02[] = {1,0,0,1};
-
 
54
double matrix03[] = {1,0,0,1};
-
 
55
double matrix04[] = {1,0,0,1};
-
 
56
double matrix05[] = {1,0,0,1};
-
 
57
double matrix06[] = {1,0,0,1};
-
 
58
double matrix07[] = {1,0,0,1};
51
typedef double matrice[4];
59
double matrix08[] = {1,0,0,1};
-
 
60
double matrix09[] = {1,0,0,1};
-
 
61
double matrix10[] = {1,0,0,1};
-
 
62
double matrix11[] = {1,0,0,1};
-
 
63
double matrix12[] = {1,0,0,1};
-
 
64
double matrix13[] = {1,0,0,1};
-
 
65
double matrix14[] = {1,0,0,1};
-
 
66
double matrix15[] = {1,0,0,1};
-
 
67
double matrix16[] = {1,0,0,1};
-
 
68
double matrix17[] = {1,0,0,1};
-
 
69
double matrix18[] = {1,0,0,1};
-
 
70
double matrix19[] = {1,0,0,1};
-
 
71
#define JC_NB_MATRICES 19
52
#define JC_NB_MATRICES 19
72
/* la matrice fixant le systeme de coordonnees "mathematiques" dans l'image */
53
/* la matrice fixant le systeme de coordonnees "mathematiques" dans l'image */
73
double *matrices_pavage[] ={ matrix,
54
matrice matrices_pavage[JC_NB_MATRICES+1];
74
        matrix01,matrix02,matrix03,matrix04,matrix05,matrix06,matrix07,matrix08,matrix09,
55
#define matrix matrices_pavage[0]
-
 
56
typedef double vecteur[2];
75
        matrix10,matrix11,matrix12,matrix13,matrix14,matrix15,matrix16,matrix17,matrix18,matrix19
57
vecteur vecteurs_pavage[JC_NB_MATRICES+1];
76
 
-
 
77
};
-
 
-
 
58
#define vector vecteurs_pavage[0]
78
/** les vecteurs suivants sont initialises par la commande setvector numvector,u_1,u_2 */
59
/** les vecteurs suivants sont initialises par la commande setvector numvector,u_1,u_2 */
79
/** ils sont remis a zero par resetvector numvector */
60
/** ils sont remis a zero par resetvector numvector */
80
double vector[] = {0,0};
-
 
81
double vector01[] = {0,0};
-
 
82
double vector02[] = {0,0};
-
 
83
double vector03[] = {0,0};
-
 
84
double vector04[] = {0,0};
-
 
85
double vector05[] = {0,0};
-
 
86
double vector06[] = {0,0};
-
 
87
double vector07[] = {0,0};
-
 
88
double vector08[] = {0,0};
-
 
89
double vector09[] = {0,0};
-
 
90
double vector10[] = {0,0};
-
 
91
double vector11[] = {0,0};
-
 
92
double vector12[] = {0,0};
-
 
93
double vector13[] = {0,0};
-
 
94
double vector14[] = {0,0};
-
 
95
double vector15[] = {0,0};
-
 
96
double vector16[] = {0,0};
-
 
97
double vector17[] = {0,0};
-
 
98
double vector18[] = {0,0};
-
 
99
double vector19[] = {0,0};
-
 
100
 
61
 
101
double *vecteurs_pavage[] ={ vector,
-
 
102
         vector01,vector02,vector03,vector04,vector05,vector06,vector07,vector08,vector09,
-
 
103
         vector10,vector11,vector12,vector13,vector14,vector15,vector16,vector17,vector18,vector19
-
 
104
};
-
 
105
 
62
 
106
/** les coordonnees du parallelograme de pavage = coordonnees "mathematiques" du parallelogramme contenant l'image a recopier **/
63
/** 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 **/
64
/** on place ces coorodonnes avec setparallelogram xs,ys,xu,yu,xv,yu **/
108
/* xs,ys=coordonnees math du point 0,0,
65
/* xs,ys=coordonnees math du point 0,0,
109
 * xu,yu coordonnees math de l'horizontale
66
 * xu,yu coordonnees math de l'horizontale
110
 * xv,yv coordonnees math de la verticale
67
 * xv,yv coordonnees math de la verticale
Line 112... Line 69...
112
 */
69
 */
113
/** TODO serait-ce un moyen de definir la brush ?? **/
70
/** TODO serait-ce un moyen de definir la brush ?? **/
114
double parallogram_fonda[]={0,0,100,0,0,100};
71
double parallogram_fonda[]={0,0,100,0,0,100};
115
 
72
 
116
/**** Fin modifs JC Fev 06 ******/
73
/**** Fin modifs JC Fev 06 ******/
117
 
74
 
118
/* Write the image */
75
/* Write the image */
119
void output(void)
76
void output(void)
120
{
77
{
121
    FILE *out;
78
    FILE *out;
122
 
79
 
Line 129... Line 86...
129
    saved=1;
86
    saved=1;
130
}
87
}
131
 
88
 
132
#include "lines.c"
89
#include "lines.c"
133
#include "nametab.c"
90
#include "nametab.c"
-
 
91
 
-
 
92
/* substitute variable names by their environment strings
-
 
93
 * The buffer pointed to by p must have enough space
-
 
94
 * (defined by MAX_LINELEN). */
-
 
95
char *substit(char *p)
-
 
96
{
134
#include "evalue.c"
97
    char *pp, *pe;
-
 
98
    char namebuf[MAX_NAMELEN+1];
-
 
99
    int i, l;
-
 
100
 
-
 
101
    pe=strchr(p,'"'); if(pe!=NULL) l=pe-p; else l=MAX_LINELEN;
-
 
102
    for(pp=find_name_start(p); *pp!=0 && pp-p<l;
-
 
103
      pp=find_name_start(pe)) {
-
 
104
      pe=find_name_end(pp);
-
 
105
      if((pp>p && !isspace(*(pp-1)) && *(pp-1)!=',') ||
-
 
106
         (*pe!=0 && !isspace(*pe) && *pe!=',')) continue;
-
 
107
      memmove(namebuf,pp,pe-pp); namebuf[pe-pp]=0;
-
 
108
      i=search_list(nametab,nametab_no,sizeof(nametab[0]),namebuf);
-
 
109
      if(i<0) continue;
-
 
110
      if(nametab[i].type==t_prep && preptab[nametab[i].serial].typ==p_font)
-
 
111
        break;
-
 
112
      if(nametab[i].type==t_color)
-
 
113
        string_modify(p,pp,pe,colortab[nametab[i].serial].def);
-
 
114
    }
-
 
115
    return p;
-
 
116
}
-
 
117
 
135
#include "vimg.c"
118
#include "vimg.c"
136
#include "objects.c"
119
#include "objects.c"
137
 
120
 
138
void process(void)
121
void process(void)
139
{
122
{
Line 149... Line 132...
149
    return evaltab_verify();
132
    return evaltab_verify();
150
}
133
}
151
 
134
 
152
int main(int argc, char *argv[])
135
int main(int argc, char *argv[])
153
{
136
{
-
 
137
  int i; for (i = 0; i <= JC_NB_MATRICES; i++)
-
 
138
           matrices_pavage [i][0] = matrices_pavage[i][3] = 1;
154
    error1=error; error2=error; error3=error;
139
    error1=error; error2=error; error3=error;
155
    substitute=substit;
140
    substitute=substit;
156
    ev_varcnt=&varcnt; ev_var=vartab;
141
    ev_varcnt=&varcnt; ev_var=vartab;
157
    if(argc==2 && strcasecmp(argv[1],"table")==0) {
142
    if(argc==2 && strcasecmp(argv[1],"table")==0) {
158
      if(verify_tables()) {
143
      if(verify_tables()) {