1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
/*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
*
*/
/*------------------------------------------------------------------------*/
/* file: DefaultCommandArg.c */
/* desc : access to default values for graphics arguments */
/*------------------------------------------------------------------------*/
#include <string.h>
#include "DefaultCommandArg.h"
/*------------------------------------------------------------------------*/
/* The default values */
static double def_rect[4] = {0.0, 0.0, 0.0, 0.0};
static char def_strf[4] = DEFSTRF ;
static char def_legend[] = "X@Y@Z" ;
static double def_zminmax[2] = {0., 0.} ;
static int def_nax[4] = {2, 10, 2, 10} ;
static int def_colminmax[2] = {0, 0} ;
static int def_colout[2] = { -1, -1} ;
static BOOL def_with_mesh = FALSE ;
static char def_logflags[4] = DEFLOGFLAGS ;
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
double* getDefRect(void)
{
return def_rect ;
}
/*------------------------------------------------------------------------*/
char * getDefStrf(void)
{
return def_strf ;
}
/*------------------------------------------------------------------------*/
char * getDefLegend(void)
{
return def_legend ;
}
/*------------------------------------------------------------------------*/
double* getDefZminMax(void)
{
return def_zminmax ;
}
/*------------------------------------------------------------------------*/
int * getDefNax(void)
{
return def_nax ;
}
/*------------------------------------------------------------------------*/
int * getDefColMinMax(void)
{
return def_colminmax ;
}
/*------------------------------------------------------------------------*/
int * getDefColOut(void)
{
return def_colout ;
}
/*------------------------------------------------------------------------*/
BOOL getDefWithMesh(void)
{
return def_with_mesh ;
}
/*------------------------------------------------------------------------*/
char * getDefLogFlags(void)
{
return def_logflags ;
}
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
void setDefRect(const double newDef[4])
{
def_rect[0] = newDef[0];
def_rect[1] = newDef[1];
def_rect[2] = newDef[2];
def_rect[3] = newDef[3];
}
/*------------------------------------------------------------------------*/
void setDefStrf(const char newDef[4])
{
def_strf[0] = newDef[0];
def_strf[1] = newDef[1];
def_strf[2] = newDef[2];
/* last element should be /0 */
}
/*------------------------------------------------------------------------*/
void setDefZminMax(const double newDef[2])
{
def_zminmax[0] = newDef[0];
def_zminmax[1] = newDef[1];
}
/*------------------------------------------------------------------------*/
void setDefNax(const int newDef[4])
{
def_nax[0] = newDef[0];
def_nax[1] = newDef[1];
def_nax[2] = newDef[2];
def_nax[3] = newDef[3];
}
/*------------------------------------------------------------------------*/
void setDefColMinMax(const int newDef[2])
{
def_colminmax[0] = newDef[0];
def_colminmax[1] = newDef[1];
}
/*------------------------------------------------------------------------*/
void setDefColOut(const int newDef[2])
{
def_colout[0] = newDef[0];
def_colout[1] = newDef[1];
}
/*------------------------------------------------------------------------*/
void setDefWithMesh(BOOL newDef)
{
def_with_mesh = newDef;
}
/*------------------------------------------------------------------------*/
void setDefLogFlags(const char newDef[4])
{
def_logflags[0] = newDef[0];
def_logflags[1] = newDef[1];
def_logflags[2] = newDef[2];
/* last element should be /0 */
}
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
void reinitDefStrf(void)
{
strcpy(def_strf, DEFSTRF);
}
/*------------------------------------------------------------------------*/
void reinitDefStrfN(void)
{
strcpy(def_strf, DEFSTRFN);
}
/*------------------------------------------------------------------------*/
void reinitDefLogFlags(void)
{
strcpy(def_logflags, DEFLOGFLAGS);
}
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
BOOL isDefRect(const double* rect)
{
return rect == def_rect;
}
/*------------------------------------------------------------------------*/
BOOL isDefStrf(const char * strf)
{
return strf == def_strf;
}
/*------------------------------------------------------------------------*/
BOOL isDefLegend(const char * legend)
{
return legend == def_legend;
}
/*------------------------------------------------------------------------*/
BOOL isDefZminMax(const double* zminmax)
{
return zminmax == def_zminmax;
}
/*------------------------------------------------------------------------*/
BOOL isDefNax(const int * nax)
{
return nax == def_nax;
}
/*------------------------------------------------------------------------*/
BOOL isDefColMinMax(const int * colminmax)
{
return colminmax == def_colminmax;
}
/*------------------------------------------------------------------------*/
BOOL isDefColOut(const int * colout)
{
return colout == def_colout;
}
/*------------------------------------------------------------------------*/
BOOL isDefWithMesh(const BOOL withmesh)
{
return withmesh == def_with_mesh;
}
/*------------------------------------------------------------------------*/
BOOL isDefLogFlags(const char * logflags)
{
return logflags == def_logflags;
}
/*------------------------------------------------------------------------*/
|