15 double height,
double tic,
int horizontal)
19 double box = (horizontal ? width : height) / (opt->
nbIso ? opt->
nbIso : 1);
21 for(
int i = 0; i < opt->
nbIso; i++) {
25 glColor4ubv((GLubyte *)&col);
28 glVertex2d(xmin + i *
box, ymin);
29 glVertex2d(xmin + (i + 1) *
box, ymin);
30 glVertex2d(xmin + (i + 1) *
box, ymin + height);
31 glVertex2d(xmin + i *
box, ymin + height);
34 glVertex2d(xmin, ymin + i *
box);
35 glVertex2d(xmin + width, ymin + i *
box);
36 glVertex2d(xmin + width, ymin + (i + 1) *
box);
37 glVertex2d(xmin, ymin + (i + 1) *
box);
44 double v1 = opt->
tmpMin + i * dv;
46 glColor4ubv((GLubyte *)&col1);
48 glVertex2d(xmin + i *
box, ymin + height);
49 glVertex2d(xmin + i *
box, ymin);
52 glVertex2d(xmin, ymin + i *
box);
53 glVertex2d(xmin + width, ymin + i *
box);
55 double v2 = opt->
tmpMin + (i + 1) * dv;
57 glColor4ubv((GLubyte *)&col2);
59 glVertex2d(xmin + (i + 1) *
box, ymin);
60 glVertex2d(xmin + (i + 1) *
box, ymin + height);
63 glVertex2d(xmin + width, ymin + (i + 1) *
box);
64 glVertex2d(xmin, ymin + (i + 1) *
box);
70 glColor4ubv((GLubyte *)&col);
73 glVertex2d(xmin +
box / 2. + i *
box, ymin);
74 glVertex2d(xmin +
box / 2. + i *
box, ymin + height);
77 glVertex2d(xmin, ymin +
box / 2. + i *
box);
78 glVertex2d(xmin + width, ymin +
box / 2. + i *
box);
86 double ymin,
double width,
double height,
87 double tic,
int horizontal)
91 if(!opt->
nbIso)
return;
101 sprintf(label, opt->
format.c_str(), -M_PI * 1.e-4);
104 int nbv = opt->
nbIso;
111 if(horizontal && width < nbv * maxw) {
117 else if(!horizontal && height < nbv * font_h) {
118 if(height <
f * font_h)
124 double box = (horizontal ? width : height) / opt->
nbIso;
125 double vbox = (horizontal ? width : height) / nbv;
132 for(
int i = 0; i < nbv + 1; i++) {
134 sprintf(label, opt->
format.c_str(), v);
140 ymin + i * vbox - font_a / 3., 0.);
145 if(opt->
nbIso > 2 && (nbv == 1 || nbv == 2)) {
146 vbox = (vbox * nbv -
box) / nbv;
149 for(
int i = 0; i < nbv; i++) {
151 sprintf(label, opt->
format.c_str(), v);
154 ymin + height + tic, 0.);
158 ymin +
box / 2. + i * vbox - font_a / 3., 0.);
165 double width,
double height,
double tic,
186 int n = (nt - n0 > 0) ? nt - n0 : 1;
200 sprintf(label,
"%s - time %s", data->
getName().c_str(), time);
204 sprintf(label,
"%s - %s part", data->
getName().c_str(),
205 ((opt->
timeStep - n0) % 2) ?
"imaginary" :
"real");
207 sprintf(label,
"%s - harmonic %s (%s part)", data->
getName().c_str(),
208 time, ((opt->
timeStep - n0) % 2) ?
"imaginary" :
"real");
214 sprintf(label,
"%s - step %d", data->
getName().c_str(), opt->
timeStep);
217 sprintf(label,
"%s - step %d in [0,%d]", data->
getName().c_str(),
221 sprintf(label,
"%s - eigenvalue %s", data->
getName().c_str(), time);
224 sprintf(label,
"%s - eigenvalue %s (%s part)", data->
getName().c_str(),
225 time, ((opt->
timeStep - n0) % 2) ?
"imaginary" :
"real");
227 default: sprintf(label,
"%s", data->
getName().c_str());
break;
232 label, xmin + width / 2., ymin + height + tic + 1.4 * font_h, 0.,
238 label, xmin, ymin - 2 * font_h, 0.,
CTX::instance()->glFontTitle,
244 double width,
double height,
double tic,
int horizontal)
267 drawScaleBar(p, xmin, ymin, width, height, tic, horizontal);
269 drawScaleLabel(ctx, p, xmin, ymin, width, height, tic, horizontal);
274 std::vector<PView *> scales;
275 for(std::size_t i = 0; i <
PView::list.size(); i++) {
283 if(scales.empty())
return;
289 for(std::size_t i = 0; i < scales.size(); i++) {
291 sprintf(label, opt->
format.c_str(), -M_PI * 1.e-4);
295 const double tic = 10., bar_size = 16.;
296 double width = 0., width_prev = 0., width_total = 0.;
298 for(std::size_t i = 0; i < scales.size(); i++) {
299 PView *p = scales[i];
304 double w = opt->
size[0], h = opt->
size[1];
307 if(
c & 1) x -= w / 2.;
308 if(
c & 2) y -= h / 2.;
315 if(scales.size() == 1) {
317 double x = xc - w / 2., y =
viewport[1] + ysep;
325 double x = xc - (i % 2 ? -xsep / 1.5 : w + xsep / 1.5);
328 (i / 2) * (bar_size + tic +
336 if(scales.size() == 1) {
346 double x =
viewport[0] + xsep + width_total + (i / 2) * xsep;
348 viewport[1] + ysep + dy + (1 - i % 2) * (h + 1.5 * dy + ysep);
353 sprintf(label, opt->
format.c_str(), -M_PI * 1.e-4);
358 sprintf(label,
"%s (%s)", data->
getName().c_str(), tmp);
361 sprintf(label,
"%s", data->
getName().c_str());
364 width_total += std::max(bar_size + width, bar_size + width_prev);