NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
plotdata.cpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2014 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19#include <mgl2/mgl.h>
20#include <map>
21#include <utility>
22#include "plotdata.hpp"
23#include "../../kernel.hpp"
24#define STYLES_COUNT 20
25
26extern mglGraph _fontData;
27const char* SECAXIS_DEFAULT_COLOR = "k";
28
29// Function prototype
30bool isNotEmptyExpression(const std::string& sExpr);
31
32
42static mu::value_type* evaluateNumerical(int& nResults, std::string sExpression)
43{
46
47 if (_data.containsTablesOrClusters(sExpression))
48 getDataElements(sExpression, _parser, _data, NumeReKernel::getInstance()->getSettings());
49
50 _parser.SetExpr(sExpression);
51
52 return _parser.Eval(nResults);
53}
54
55
56
65static bool checkColorChars(const std::string& sColorSet)
66{
67 static std::string sColorChars = "#| wWhHkRrQqYyEeGgLlCcNnBbUuMmPp123456789{}";
68
69 for (size_t i = 0; i < sColorSet.length(); i++)
70 {
71 if (sColorSet[i] == '{' && i+3 >= sColorSet.length())
72 return false;
73 else if (sColorSet[i] == '{'
74 && (sColorSet[i+3] != '}'
75 || sColorChars.substr(3,sColorChars.length()-14).find(sColorSet[i+1]) == std::string::npos
76 || sColorSet[i+2] > '9'
77 || sColorSet[i+2] < '1'))
78 return false;
79
80 if (sColorChars.find(sColorSet[i]) == std::string::npos)
81 return false;
82 }
83
84 return true;
85}
86
87
97static bool checkLineChars(const std::string& sLineSet)
98{
99 static std::string sLineChars = " -:;ij|=";
100
101 for (size_t i = 0; i < sLineSet.length(); i++)
102 {
103 if (sLineChars.find(sLineSet[i]) == std::string::npos)
104 return false;
105 }
106
107 return true;
108}
109
110
120static bool checkPointChars(const std::string& sPointSet)
121{
122 static std::string sPointChars = " .*+x#sdo^v<>";
123
124 for (size_t i = 0; i < sPointSet.length(); i++)
125 {
126 if (sPointChars.find(sPointSet[i]) == std::string::npos)
127 return false;
128 }
129
130 return true;
131}
132
133
141static std::map<std::string,std::pair<PlotData::LogicalPlotSetting,PlotData::ParamType>> getGenericSwitches()
142{
143 std::map<std::string,std::pair<PlotData::LogicalPlotSetting,PlotData::ParamType>> mGenericSwitches;
144
145 mGenericSwitches.emplace("box", std::make_pair(PlotData::LOG_BOX, PlotData::GLOBAL));
146 mGenericSwitches.emplace("xerrorbars", std::make_pair(PlotData::LOG_XERROR, PlotData::LOCAL));
147 mGenericSwitches.emplace("yerrorbars", std::make_pair(PlotData::LOG_YERROR, PlotData::LOCAL));
148 mGenericSwitches.emplace("connect", std::make_pair(PlotData::LOG_CONNECTPOINTS, PlotData::LOCAL));
149 mGenericSwitches.emplace("points", std::make_pair(PlotData::LOG_DRAWPOINTS, PlotData::LOCAL));
150 mGenericSwitches.emplace("interpolate", std::make_pair(PlotData::LOG_INTERPOLATE, PlotData::LOCAL));
151 mGenericSwitches.emplace("open", std::make_pair(PlotData::LOG_OPENIMAGE, PlotData::SUPERGLOBAL));
152 mGenericSwitches.emplace("silent", std::make_pair(PlotData::LOG_SILENTMODE, PlotData::SUPERGLOBAL));
153 mGenericSwitches.emplace("cut", std::make_pair(PlotData::LOG_CUTBOX, PlotData::LOCAL));
154 mGenericSwitches.emplace("flength", std::make_pair(PlotData::LOG_FIXEDLENGTH, PlotData::LOCAL));
155 mGenericSwitches.emplace("colorbar", std::make_pair(PlotData::LOG_COLORBAR, PlotData::LOCAL));
156 mGenericSwitches.emplace("orthoproject", std::make_pair(PlotData::LOG_ORTHOPROJECT, PlotData::GLOBAL));
157 mGenericSwitches.emplace("area", std::make_pair(PlotData::LOG_AREA, PlotData::LOCAL));
158 mGenericSwitches.emplace("steps", std::make_pair(PlotData::LOG_STEPPLOT, PlotData::LOCAL));
159 mGenericSwitches.emplace("boxplot", std::make_pair(PlotData::LOG_BOXPLOT, PlotData::LOCAL));
160 mGenericSwitches.emplace("colormask", std::make_pair(PlotData::LOG_COLORMASK, PlotData::LOCAL));
161 mGenericSwitches.emplace("alphamask", std::make_pair(PlotData::LOG_ALPHAMASK, PlotData::LOCAL));
162 mGenericSwitches.emplace("schematic", std::make_pair(PlotData::LOG_SCHEMATIC, PlotData::GLOBAL));
163 mGenericSwitches.emplace("cloudplot", std::make_pair(PlotData::LOG_CLOUDPLOT, PlotData::LOCAL));
164 mGenericSwitches.emplace("region", std::make_pair(PlotData::LOG_REGION, PlotData::LOCAL));
165 mGenericSwitches.emplace("crust", std::make_pair(PlotData::LOG_CRUST, PlotData::LOCAL));
166 mGenericSwitches.emplace("reconstruct", std::make_pair(PlotData::LOG_CRUST, PlotData::LOCAL));
167 mGenericSwitches.emplace("valtab", std::make_pair(PlotData::LOG_TABLE, PlotData::GLOBAL));
168
169 return mGenericSwitches;
170}
171
172
181static std::map<std::string, std::string> getColorSchemes()
182{
183 std::map<std::string, std::string> mColorSchemes;
184
185 mColorSchemes.emplace("rainbow", "BbcyrR");
186 mColorSchemes.emplace("grey", "kw");
187 mColorSchemes.emplace("hot", "{R1}{r4}qy");
188 mColorSchemes.emplace("cold", "{B2}n{c8}");
189 mColorSchemes.emplace("copper", "{Q2}{q3}{q9}");
190 mColorSchemes.emplace("map", "UBbcgyqRH");
191 mColorSchemes.emplace("moy", "kMqyw");
192 mColorSchemes.emplace("coast", "{B6}{c3}{y8}");
193 mColorSchemes.emplace("viridis", "{U3}{N4}C{e4}y"); //UNC{e4}y
194 mColorSchemes.emplace("std", "{U3}{N4}C{e4}y");
195 mColorSchemes.emplace("plasma", "B{u4}p{q6}{y7}");
196 mColorSchemes.emplace("hue", "rygcbmr");
197 mColorSchemes.emplace("polarity", "w{n5}{u2}{r7}w");
198 mColorSchemes.emplace("complex", "w{n5}{u2}{r7}w");
199 mColorSchemes.emplace("spectral", "{R6}{q6}{y8}{l6}{N6}");
200 mColorSchemes.emplace("coolwarm", "{n6}{r7}");
201 mColorSchemes.emplace("ryg", "{R6}{y7}{G6}");
202
203 return mColorSchemes;
204}
205
206
207
208
209
210
211
217{
219}
220
221
233void PlotData::setParams(const std::string& __sCmd, int nType)
234{
236 static std::map<std::string,std::pair<PlotData::LogicalPlotSetting,PlotData::ParamType>> mGenericSwitches = getGenericSwitches();
237 static std::map<std::string,std::string> mColorSchemes = getColorSchemes();
238 constexpr int STRINGEXTRACT = ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED | ARGEXTRACT_STRIPPED;
239
240 std::string sCmd = toLowerCase(__sCmd);
241
242 if (findParameter(sCmd, "reset") && (nType == ALL || nType & SUPERGLOBAL))
243 reset();
244
245 // Handle generic switches first
246 for (const auto& iter : mGenericSwitches)
247 {
248 if (findParameter(sCmd, iter.first) && (nType == ALL || nType & iter.second.second))
249 logicalSettings[iter.second.first] = true;
250 else if (findParameter(sCmd, "no" + iter.first) && (nType == ALL || nType & iter.second.second))
251 logicalSettings[iter.second.first] = false;
252 }
253
254 if (findParameter(sCmd, "grid") && (nType == ALL || nType & GLOBAL))
256
257 if (findParameter(sCmd, "grid", '=') && (nType == ALL || nType & GLOBAL))
258 {
259 unsigned int nPos = findParameter(sCmd, "grid", '=')+4;
260
261 if (getArgAtPos(sCmd, nPos) == "fine")
263 else if (getArgAtPos(sCmd, nPos) == "coarse")
265 else
267 }
268
269 if (findParameter(sCmd, "nogrid") && (nType == ALL || nType & GLOBAL))
271
272 if ((findParameter(sCmd, "alpha") || findParameter(sCmd, "transparency")) && (nType == ALL || nType & LOCAL))
273 {
275
276 if (findParameter(sCmd, "alpha", '='))
277 {
278 _parser.SetExpr(getArgAtPos(sCmd, findParameter(sCmd, "alpha", '=')+5));
279 floatSettings[FLOAT_ALPHAVAL] = 1 - _parser.Eval().real();
280
283 }
284
285 if (findParameter(sCmd, "transparency", '='))
286 {
287 _parser.SetExpr(getArgAtPos(sCmd, findParameter(sCmd, "transparency", '=')+12));
288 floatSettings[FLOAT_ALPHAVAL] = 1 - _parser.Eval().real();
289
292 }
293 }
294
295 if ((findParameter(sCmd, "noalpha") || findParameter(sCmd, "notransparency")) && (nType == ALL || nType & LOCAL))
296 logicalSettings[LOG_ALPHA] = false;
297
298 if (findParameter(sCmd, "axis") && (nType == ALL || nType & GLOBAL))
299 {
301
302 if (findParameter(sCmd, "axis", '='))
303 {
304 if (getArgAtPos(sCmd, findParameter(sCmd, "axis", '=')+4) == "nice")
306 else if (getArgAtPos(sCmd, findParameter(sCmd, "axis", '=')+4) == "equal")
308 }
309 }
310
311 if (findParameter(sCmd, "noaxis") && (nType == ALL || nType & GLOBAL))
313
314 if (findParameter(sCmd, "light") && (nType == ALL || nType & LOCAL))
316
317 if (findParameter(sCmd, "light", '=') && (nType == ALL || nType & LOCAL))
318 {
319 if (getArgAtPos(sCmd, findParameter(sCmd, "light", '=')+5) == "smooth")
321 else if (getArgAtPos(sCmd, findParameter(sCmd, "light", '=')+5) == "soft")
323 else
325 }
326
327 if (findParameter(sCmd, "nolight") && (nType == ALL || nType & LOCAL))
329
330 if (findParameter(sCmd, "lcont") && (nType == ALL || nType & LOCAL))
331 {
333
334 if (findParameter(sCmd, "lcont", '='))
335 {
336 _parser.SetExpr(getArgAtPos(sCmd, findParameter(sCmd, "lcont", '=')));
338 }
339 }
340
341 if (findParameter(sCmd, "nolcont") && (nType == ALL || nType & LOCAL))
343
344 if (findParameter(sCmd, "pcont") && (nType == ALL || nType & LOCAL))
345 {
347
348 if (findParameter(sCmd, "pcont", '='))
349 {
350 _parser.SetExpr(getArgAtPos(sCmd, findParameter(sCmd, "pcont", '=')));
352 }
353 }
354
355 if (findParameter(sCmd, "nopcont") && (nType == ALL || nType & LOCAL))
357
358 if (findParameter(sCmd, "fcont") && (nType == ALL || nType & LOCAL))
359 {
361
362 if (findParameter(sCmd, "fcont", '='))
363 {
364 _parser.SetExpr(getArgAtPos(sCmd, findParameter(sCmd, "fcont", '=')));
366 }
367 }
368
369 if (findParameter(sCmd, "nofcont") && (nType == ALL || nType & LOCAL))
371
372 if (findParameter(sCmd, "errorbars") && (nType == ALL || nType & LOCAL))
373 {
376 }
377
378 if (findParameter(sCmd, "noerrorbars") && (nType == ALL || nType & LOCAL))
379 {
382 }
383
384 if (findParameter(sCmd, "logscale") && (nType == ALL || nType & GLOBAL))
385 {
386 for (int i = XRANGE; i <= CRANGE; i++)
387 {
388 bLogscale[i] = true;
389 }
390 }
391
392 if (findParameter(sCmd, "nologscale") && (nType == ALL || nType & GLOBAL))
393 {
394 for (int i = XRANGE; i <= CRANGE; i++)
395 {
396 bLogscale[i] = false;
397 }
398 }
399
400 if (findParameter(sCmd, "xlog") && (nType == ALL || nType & GLOBAL))
401 bLogscale[XRANGE] = true;
402
403 if (findParameter(sCmd, "ylog") && (nType == ALL || nType & GLOBAL))
404 bLogscale[YRANGE] = true;
405
406 if (findParameter(sCmd, "zlog") && (nType == ALL || nType & GLOBAL))
407 bLogscale[ZRANGE] = true;
408
409 if (findParameter(sCmd, "clog") && (nType == ALL || nType & GLOBAL))
410 bLogscale[CRANGE] = true;
411
412 if (findParameter(sCmd, "noxlog") && (nType == ALL || nType & GLOBAL))
413 bLogscale[XRANGE] = false;
414
415 if (findParameter(sCmd, "noylog") && (nType == ALL || nType & GLOBAL))
416 bLogscale[YRANGE] = false;
417
418 if (findParameter(sCmd, "nozlog") && (nType == ALL || nType & GLOBAL))
419 bLogscale[ZRANGE] = false;
420
421 if (findParameter(sCmd, "noclog") && (nType == ALL || nType & GLOBAL))
422 bLogscale[CRANGE] = false;
423
424 if (findParameter(sCmd, "samples", '=') && (nType == ALL || nType & LOCAL))
425 {
426 int nPos = findParameter(sCmd, "samples", '=') + 7;
427 _parser.SetExpr(getArgAtPos(__sCmd, nPos));
428 intSettings[INT_SAMPLES] = intCast(_parser.Eval());
429
430 if (isnan(_parser.Eval().real()) || isinf(_parser.Eval().real()))
432 }
433
434 if (findParameter(sCmd, "t", '=') && (nType == ALL || nType & LOCAL))
435 {
436 int nPos = findParameter(sCmd, "t", '=')+1;
437 std::string sTemp_1 = getArgAtPos(__sCmd, nPos);
438 ranges[TRANGE].reset(sTemp_1);
439 }
440
441 if (findParameter(sCmd, "colorrange", '=') && (nType == ALL || nType & GLOBAL))
442 {
443 unsigned int nPos = findParameter(sCmd, "colorrange", '=') + 10;
444 std::string sTemp_1 = getArgAtPos(__sCmd, nPos);
445 ranges[CRANGE].reset(sTemp_1);
446
447 if (ranges[CRANGE].front().real() > ranges[CRANGE].back().real())
448 {
449 bMirror[CRANGE] = true;
450 ranges[CRANGE].reset(ranges[CRANGE].back(), ranges[CRANGE].front());
451 }
452 }
453
454 if (findParameter(sCmd, "rotate", '=') && (nType == ALL || nType & GLOBAL))
455 {
456 int nPos = findParameter(sCmd, "rotate", '=')+6;
457 std::string sTemp = getArgAtPos(__sCmd, nPos);
458 if (sTemp.find(",") != std::string::npos && sTemp.length() > 1)
459 {
460 if (sTemp.find(',') && sTemp.find(',') != sTemp.length()-1)
461 {
462 int nResults;
463 mu::value_type* dTemp = evaluateNumerical(nResults, sTemp);
464 dRotateAngles[0] = dTemp[0].real();
465 dRotateAngles[1] = dTemp[1].real();
466 }
467 else if (!sTemp.find(','))
468 {
469 _parser.SetExpr(sTemp.substr(1));
470 dRotateAngles[1] = _parser.Eval().real();
471 }
472 else if (sTemp.find(',') == sTemp.length()-1)
473 {
474 _parser.SetExpr(sTemp.substr(0,sTemp.length()-1));
475 dRotateAngles[0] = _parser.Eval().real();
476 }
477
478 for (unsigned int i = 0; i < 2; i++)
479 {
480 if (isinf(dRotateAngles[i]) || isnan(dRotateAngles[i]))
481 {
482 if (!i)
483 dRotateAngles[i] = 60;
484 else
485 dRotateAngles[i] = 115;
486 }
487 }
488
489 if (dRotateAngles[0] < 0)
490 dRotateAngles[0] += ceil(-dRotateAngles[0]/180.0)*180.0;
491
492 if (dRotateAngles[0] > 180)
493 dRotateAngles[0] -= floor(dRotateAngles[0]/180.0)*180.0;
494
495 if (dRotateAngles[1] < 0)
496 dRotateAngles[1] += ceil(-dRotateAngles[1]/360.0)*360.0;
497
498 if (dRotateAngles[1] > 360)
499 dRotateAngles[1] -= floor(dRotateAngles[1]/360.0)*360.0;
500
501 }
502 }
503
504 if (findParameter(sCmd, "origin", '=') && (nType == ALL || nType & GLOBAL))
505 {
506 int nPos = findParameter(sCmd, "origin", '=')+6;
507 std::string sTemp = getArgAtPos(__sCmd, nPos);
508 if (sTemp.find(',') != std::string::npos && sTemp.length() > 1)
509 {
510 int nResults = 0;
511 mu::value_type* dTemp = evaluateNumerical(nResults, sTemp);
512 if (nResults)
513 {
514 for (int i = 0; i < 3; i++)
515 {
516 if (i < nResults && !isnan(dTemp[i].real()) && !isinf(dTemp[i].real()))
517 dOrigin[i] = dTemp[i].real();
518 else
519 dOrigin[i] = 0.0;
520 }
521 }
522 }
523 else if (sTemp == "sliding")
524 {
525 for (int i = 0; i < 3; i++)
526 dOrigin[i] = NAN;
527 }
528 else
529 {
530 for (int i = 0; i < 3; i++)
531 dOrigin[i] = 0.0;
532 }
533 }
534
535 if (findParameter(sCmd, "slices", '=') && (nType == ALL || nType & LOCAL))
536 {
537 int nPos = findParameter(sCmd, "slices", '=')+6;
538 std::string sTemp = getArgAtPos(__sCmd, nPos);
539 if (sTemp.find(',') != std::string::npos && sTemp.length() > 1)
540 {
541 int nResults;
542 mu::value_type* dTemp = evaluateNumerical(nResults, sTemp);
543
544 if (nResults)
545 {
546 for (int i = 0; i < 3; i++)
547 {
548 if (i < nResults && !isnan(dTemp[i].real()) && !isinf(dTemp[i].real()) && dTemp[i].real() <= 5 && dTemp[i].real() >= 0)
549 nSlices[i] = (unsigned short)dTemp[i].real();
550 else
551 nSlices[i] = 1;
552 }
553 }
554 }
555 else
556 {
557 for (int i = 0; i < 3; i++)
558 nSlices[i] = 1;
559 }
560 }
561
562 if (findParameter(sCmd, "streamto", '=') && (nType == ALL || nType & SUPERGLOBAL))
563 {
564 int nPos = findParameter(sCmd, "streamto", '=')+8;
565 std::string sTemp = getArgAtPos(__sCmd, nPos);
566 if (sTemp.find(',') != std::string::npos && sTemp.length() > 1)
567 {
568 int nResults = 0;
569 mu::value_type* dTemp = evaluateNumerical(nResults, sTemp);
570
571 if (nResults >= 2)
572 {
573 nTargetGUI[0] = intCast(dTemp[0]);
574 nTargetGUI[1] = intCast(dTemp[1]);
575 }
576 }
577 }
578
579 if (findParameter(sCmd, "size", '=') && (nType == ALL || nType & SUPERGLOBAL))
580 {
581 int nPos = findParameter(sCmd, "size", '=')+4;
582 std::string sTemp = getArgAtPos(__sCmd, nPos);
583 if (sTemp.find(',') != std::string::npos && sTemp.length() > 1)
584 {
585 int nResults = 0;
586 mu::value_type* dTemp = evaluateNumerical(nResults, sTemp);
587
588 if (nResults >= 2)
589 {
590 intSettings[INT_SIZE_X] = intCast(dTemp[0]);
591 intSettings[INT_SIZE_Y] = intCast(dTemp[1]);
592
595 else
596 {
599 }
600 }
601 }
602 }
603
604 if (findParameter(sCmd, "hires") && (nType == ALL || nType & SUPERGLOBAL))
606
607 if (findParameter(sCmd, "hires", '=') && (nType == ALL || nType & SUPERGLOBAL))
608 {
609 int nPos = findParameter(sCmd, "hires", '=')+5;
610
611 if (getArgAtPos(sCmd, nPos) == "all")
612 {
615 }
616 else if (getArgAtPos(sCmd, nPos) == "allmedium")
617 {
620 }
621 else if (getArgAtPos(sCmd, nPos) == "medium")
622 {
624 }
625 }
626
627 if (findParameter(sCmd, "complexmode", '=') && (nType == ALL || nType & SUPERGLOBAL))
628 {
629 int nPos = findParameter(sCmd, "complexmode", '=')+11;
630
631 if (getArgAtPos(sCmd, nPos) == "reim")
633 else if (getArgAtPos(sCmd, nPos) == "plane")
635 else
637 }
638
639 if (findParameter(sCmd, "legend", '=') && (nType == ALL || nType & GLOBAL))
640 {
641 int nPos = findParameter(sCmd, "legend", '=')+6;
642 if (getArgAtPos(sCmd, nPos) == "topleft" || getArgAtPos(sCmd, nPos) == "left")
644 else if (getArgAtPos(sCmd, nPos) == "bottomleft")
646 else if (getArgAtPos(sCmd, nPos) == "bottomright")
648 else
650 }
651
652 if (findParameter(sCmd, "nohires") && (nType == ALL || nType & SUPERGLOBAL))
653 {
656 }
657
658 if (findParameter(sCmd, "animate") && (nType == ALL || nType & SUPERGLOBAL))
660
661 if (findParameter(sCmd, "animate", '=') && (nType == ALL || nType & SUPERGLOBAL))
662 {
663 unsigned int nPos = findParameter(sCmd, "animate", '=')+7;
664 _parser.SetExpr(getArgAtPos(__sCmd, nPos));
666 if (intSettings[INT_ANIMATESAMPLES] && !isinf(_parser.Eval()) && !isnan(_parser.Eval()))
668 else
669 {
672 }
677 }
678
679 if (findParameter(sCmd, "marks", '=') && (nType == ALL || nType & LOCAL))
680 {
681 unsigned int nPos = findParameter(sCmd, "marks", '=')+5;
682 _parser.SetExpr(getArgAtPos(__sCmd, nPos));
683 intSettings[INT_MARKS] = intCast(_parser.Eval());
684 if (!intSettings[INT_MARKS] || isinf(_parser.Eval().real()) || isnan(_parser.Eval().real()))
686 if (intSettings[INT_MARKS] > 9)
688 if (intSettings[INT_MARKS] < 0)
690 }
691
692 if (findParameter(sCmd, "nomarks") && (nType == ALL || nType & LOCAL))
694
695 if (findParameter(sCmd, "textsize", '=') && (nType == ALL || nType & SUPERGLOBAL))
696 {
697 unsigned int nPos = findParameter(sCmd, "textsize", '=')+8;
698 _parser.SetExpr(getArgAtPos(__sCmd, nPos));
699 floatSettings[FLOAT_TEXTSIZE] = _parser.Eval().real();
700
703
704 if (floatSettings[FLOAT_TEXTSIZE] <= -1)
706 }
707
708 if (findParameter(sCmd, "aspect", '=') && (nType == ALL || nType & SUPERGLOBAL))
709 {
710 unsigned int nPos = findParameter(sCmd, "aspect", '=') + 6;
711 _parser.SetExpr(getArgAtPos(__sCmd, nPos));
712 floatSettings[FLOAT_ASPECT] = _parser.Eval().real();
715 }
716
717 if (findParameter(sCmd, "noanimate") && (nType == ALL || nType & SUPERGLOBAL))
719
720 if (findParameter(sCmd, "flow") && (nType == ALL || nType & LOCAL))
721 {
723 logicalSettings[LOG_PIPE] = false;
724 }
725
726 if (findParameter(sCmd, "noflow") && (nType == ALL || nType & LOCAL))
727 logicalSettings[LOG_FLOW] = false;
728
729 if (findParameter(sCmd, "pipe") && (nType == ALL || nType & LOCAL))
730 {
732 logicalSettings[LOG_FLOW] = false;
733 }
734
735 if (findParameter(sCmd, "nopipe") && (nType == ALL || nType & LOCAL))
736 logicalSettings[LOG_PIPE] = false;
737
738 if (findParameter(sCmd, "bars") && (nType == ALL || nType & LOCAL))
739 {
742 }
743
744 if (findParameter(sCmd, "bars", '=') && (nType == ALL || nType & LOCAL))
745 {
746 _parser.SetExpr(getArgAtPos(__sCmd, findParameter(sCmd, "bars", '=')+4));
747 floatSettings[FLOAT_BARS] = _parser.Eval().real();
749 && !isinf(_parser.Eval().real())
750 && !isnan(_parser.Eval().real())
751 && (floatSettings[FLOAT_BARS] < 0.0 || floatSettings[FLOAT_BARS] > 1.0))
754 }
755
756 if (findParameter(sCmd, "hbars") && (nType == ALL || nType & LOCAL))
757 {
760 }
761
762 if (findParameter(sCmd, "hbars", '=') && (nType == ALL || nType & LOCAL))
763 {
764 _parser.SetExpr(getArgAtPos(__sCmd, findParameter(sCmd, "hbars", '=')+5));
765 floatSettings[FLOAT_HBARS] = _parser.Eval().real();
767 && !isinf(_parser.Eval().real())
768 && !isnan(_parser.Eval().real())
772 }
773
774 if ((findParameter(sCmd, "nobars") || findParameter(sCmd, "nohbars")) && (nType == ALL || nType & LOCAL))
775 {
778 }
779
780 if (findParameter(sCmd, "perspective", '=') && (nType == ALL || nType & GLOBAL))
781 {
782 _parser.SetExpr(getArgAtPos(__sCmd, findParameter(sCmd, "perspective", '=')+11));
783 floatSettings[FLOAT_PERSPECTIVE] = fabs(_parser.Eval());
786 }
787
788 if (findParameter(sCmd, "noperspective") && (nType == ALL || nType & GLOBAL))
790
791 if (findParameter(sCmd, "maxline", '=') && (nType == ALL || nType & LOCAL))
792 {
793 std::string sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "maxline", '=')+7);
794 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
795 sTemp = sTemp.substr(1,sTemp.length()-2);
796 _lHlines[0].sDesc = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
797 if (sTemp.length())
798 _lHlines[0].sStyle = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
800 }
801
802 if (findParameter(sCmd, "minline", '=') && (nType == ALL || nType & LOCAL))
803 {
804 std::string sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "minline", '=')+7);
805 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
806 sTemp = sTemp.substr(1,sTemp.length()-2);
807 _lHlines[1].sDesc = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
808 if (sTemp.length())
809 _lHlines[1].sStyle = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
811 }
812
813 if ((findParameter(sCmd, "hline", '=') || findParameter(sCmd, "hlines", '=')) && (nType == ALL || nType & LOCAL))
814 {
815 std::string sTemp;
816 if (findParameter(sCmd, "hline", '='))
817 sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "hline", '=')+5);
818 else
819 sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "hlines", '=')+6);
820 if (sTemp.find(',') != std::string::npos)
821 {
822 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
823 sTemp = sTemp.substr(1,sTemp.length()-2);
824
825 value_type* v = nullptr;
826 int nResults = 0;
827 v = evaluateNumerical(nResults, getNextArgument(sTemp, true));
828
829 for (int i = 0; i < nResults; i++)
830 {
831 if (i)
832 _lHlines.push_back(Line());
833
834 _lHlines[i+2].dPos = v[i].real();
835 }
836
837 std::string sDescList = getArgAtPos(getNextArgument(sTemp, true),0,ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED);
838
839 if (sDescList.front() == '{')
840 sDescList.erase(0,1);
841 if (sDescList.back() == '}')
842 sDescList.erase(sDescList.length()-1);
843 for (size_t i = 2; i < _lHlines.size(); i++)
844 {
845 if (!sDescList.length())
846 break;
847 _lHlines[i].sDesc = removeSurroundingQuotationMarks(getNextArgument(sDescList, true));
849 }
850
851 if (sTemp.length())
852 {
853 std::string sStyles = getArgAtPos(getNextArgument(sTemp, true),0,ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED);
854 if (sStyles.front() == '{')
855 sStyles.erase(0,1);
856 if (sStyles.back() == '}')
857 sStyles.erase(sStyles.length()-1);
858 for (size_t i = 2; i < _lHlines.size(); i++)
859 {
860 if (!sStyles.length())
861 break;
862 _lHlines[i].sStyle = removeSurroundingQuotationMarks(getNextArgument(sStyles, true));
863 }
864 }
865 }
866 }
867
868 if ((findParameter(sCmd, "vline", '=') || findParameter(sCmd, "vlines", '=')) && (nType == ALL || nType & LOCAL))
869 {
870 std::string sTemp;
871 if (findParameter(sCmd, "vline", '='))
872 sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "vline", '=')+5);
873 else
874 sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "vlines", '=')+6);
875 if (sTemp.find(',') != std::string::npos)
876 {
877 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
878 sTemp = sTemp.substr(1,sTemp.length()-2);
879
880 value_type* v = nullptr;
881 int nResults = 0;
882 v = evaluateNumerical(nResults, getNextArgument(sTemp, true));
883
884 for (int i = 0; i < nResults; i++)
885 {
886 if (i)
887 _lVLines.push_back(Line());
888
889 _lVLines[i+2].dPos = v[i].real();
890 }
891
892 std::string sDescList = getArgAtPos(getNextArgument(sTemp, true),0, ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED);
893
894 if (sDescList.front() == '{')
895 sDescList.erase(0,1);
896 if (sDescList.back() == '}')
897 sDescList.erase(sDescList.length()-1);
898 for (size_t i = 2; i < _lVLines.size(); i++)
899 {
900 if (!sDescList.length())
901 break;
902 _lVLines[i].sDesc = removeSurroundingQuotationMarks(getNextArgument(sDescList, true));
904 }
905
906 if (sTemp.length())
907 {
908 std::string sStyles = getArgAtPos(getNextArgument(sTemp, true),0, ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED);
909 if (sStyles.front() == '{')
910 sStyles.erase(0,1);
911 if (sStyles.back() == '}')
912 sStyles.erase(sStyles.length()-1);
913 for (size_t i = 2; i < _lVLines.size(); i++)
914 {
915 if (!sStyles.length())
916 break;
917 _lVLines[i].sStyle = removeSurroundingQuotationMarks(getNextArgument(sStyles, true));
918 }
919 }
920 }
921 }
922
923 if (findParameter(sCmd, "timeaxes", '=') && (nType == ALL || nType & GLOBAL))
924 {
925 std::string sTemp;
926 sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "timeaxes", '=')+8);
927
928 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
929 sTemp = sTemp.substr(1,sTemp.length()-2);
930
931 std::string sAxesList = getArgAtPos(getNextArgument(sTemp, true), 0, ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED);
932
933 if (sAxesList.front() == '{')
934 sAxesList.erase(0,1);
935
936 if (sAxesList.back() == '}')
937 sAxesList.erase(sAxesList.length()-1);
938
939 std::string sFormat;
940
941 if (sTemp.length())
942 {
944
945 if (sFormat.front() == '{')
946 sFormat.erase(0,1);
947
948 if (sFormat.back() == '}')
949 sFormat.erase(sFormat.length()-1);
950 }
951
952 while (sAxesList.length())
953 {
954 std::string sAxis = removeSurroundingQuotationMarks(getNextArgument(sAxesList, true));
955
956 if (sAxis == "c")
958 else if (sAxis.find_first_of("xyz") != std::string::npos)
960 }
961 }
962
963 if (findParameter(sCmd, "lborder", '=') && (nType == ALL || nType & LOCAL))
964 {
965 std::string sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "lborder", '=')+7);
966 if (sTemp.find(',') != std::string::npos)
967 {
968 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
969 sTemp = sTemp.substr(1,sTemp.length()-2);
970 _parser.SetExpr(getNextArgument(sTemp, true));
971 _lVLines[0].dPos = _parser.Eval().real();
972 _lVLines[0].sDesc = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
973 if (sTemp.length())
974 _lVLines[0].sStyle = getArgAtPos(getNextArgument(sTemp, true),0, STRINGEXTRACT);
975 }
977 }
978
979 if (findParameter(sCmd, "rborder", '=') && (nType == ALL || nType & LOCAL))
980 {
981 std::string sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "rborder", '=')+7);
982 if (sTemp.find(',') != std::string::npos)
983 {
984 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
985 sTemp = sTemp.substr(1,sTemp.length()-2);
986 _parser.SetExpr(getNextArgument(sTemp, true));
987 _lVLines[1].dPos = _parser.Eval().real();
988 _lVLines[1].sDesc = getArgAtPos(getNextArgument(sTemp, true),0, STRINGEXTRACT);
989 if (sTemp.length())
990 _lVLines[1].sStyle = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
991 }
993 }
994
995 if (findParameter(sCmd, "addxaxis", '=') && (nType == ALL || nType & GLOBAL))
996 {
997 std::string sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "addxaxis", '=')+8);
998
999 if (sTemp.find(',') != std::string::npos || sTemp.find('"') != std::string::npos)
1000 {
1001 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
1002 sTemp = sTemp.substr(1,sTemp.length()-2);
1003
1004 if (getNextArgument(sTemp, false).front() != '"')
1005 {
1006 int nRes;
1007 mu::value_type minval = evaluateNumerical(nRes, getNextArgument(sTemp, true))[0];
1008 _AddAxes[0].ivl.reset(minval, evaluateNumerical(nRes, getNextArgument(sTemp, true))[0]);
1009
1010 if (getNextArgument(sTemp, false).length())
1011 {
1012 _AddAxes[0].sLabel = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1013
1014 if (getNextArgument(sTemp, false).length())
1015 {
1016 _AddAxes[0].sStyle = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1017
1018 if (!checkColorChars(_AddAxes[0].sStyle))
1020 }
1021 }
1022 else
1023 _AddAxes[0].sLabel = "\\i x";
1024 }
1025 else
1026 {
1027 _AddAxes[0].sLabel = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1028
1029 if (getNextArgument(sTemp, false).length())
1030 {
1031 _AddAxes[0].sStyle = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1032
1033 if (!checkColorChars(_AddAxes[0].sStyle))
1035 }
1036 }
1037 }
1038 }
1039
1040 if (findParameter(sCmd, "addyaxis", '=') && (nType == ALL || nType & GLOBAL))
1041 {
1042 std::string sTemp = getArgAtPos(__sCmd, findParameter(sCmd, "addyaxis", '=')+8);
1043
1044 if (sTemp.find(',') != std::string::npos || sTemp.find('"') != std::string::npos)
1045 {
1046 if (sTemp[0] == '(' && sTemp[sTemp.length()-1] == ')')
1047 sTemp = sTemp.substr(1,sTemp.length()-2);
1048
1049 if (getNextArgument(sTemp, false).front() != '"')
1050 {
1051 int nRes;
1052 mu::value_type minval = evaluateNumerical(nRes, getNextArgument(sTemp, true))[0];
1053 _AddAxes[1].ivl.reset(minval, evaluateNumerical(nRes, getNextArgument(sTemp, true))[0]);
1054
1055 if (getNextArgument(sTemp, false).length())
1056 {
1057 _AddAxes[1].sLabel = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1058
1059 if (getNextArgument(sTemp, false).length())
1060 {
1061 _AddAxes[1].sStyle = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1062
1063 if (!checkColorChars(_AddAxes[0].sStyle))
1065 }
1066 }
1067 else
1068 _AddAxes[1].sLabel = "\\i y";
1069 }
1070 else
1071 {
1072 _AddAxes[1].sLabel = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1073
1074 if (getNextArgument(sTemp, false).length())
1075 {
1076 _AddAxes[1].sStyle = getArgAtPos(getNextArgument(sTemp, true),0,STRINGEXTRACT);
1077
1078 if (!checkColorChars(_AddAxes[1].sStyle))
1080 }
1081 }
1082 }
1083 //replaceControlChars(_[1].sDesc);
1084 }
1085
1086 if (findParameter(sCmd, "colorscheme", '=') && (nType == ALL || nType & LOCAL))
1087 {
1088 unsigned int nPos = findParameter(sCmd, "colorscheme", '=') + 11;
1089 std::string sTemp = getArgAtPos(__sCmd, nPos, ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED);
1090
1091 if (sTemp.front() == '"')
1092 {
1093 std::string __sColorScheme = removeSurroundingQuotationMarks(sTemp);
1094 StripSpaces(__sColorScheme);
1095
1096 if (!checkColorChars(__sColorScheme))
1097 stringSettings[STR_COLORSCHEME] = mColorSchemes["std"];
1098 else
1099 {
1100 if (__sColorScheme == "#" && stringSettings[STR_COLORSCHEME].find('#') == std::string::npos)
1102 else if (__sColorScheme == "|" && stringSettings[STR_COLORSCHEME].find('|') == std::string::npos)
1104 else if ((__sColorScheme == "#|" || __sColorScheme == "|#") && (stringSettings[STR_COLORSCHEME].find('#') == std::string::npos || stringSettings[STR_COLORSCHEME].find('|') == std::string::npos))
1105 {
1106 if (stringSettings[STR_COLORSCHEME].find('#') == std::string::npos && stringSettings[STR_COLORSCHEME].find('|') != std::string::npos)
1108 else if (stringSettings[STR_COLORSCHEME].find('|') == std::string::npos && stringSettings[STR_COLORSCHEME].find('#') != std::string::npos)
1110 else
1112 }
1113 else if (__sColorScheme != "#" && __sColorScheme != "|" && __sColorScheme != "#|" && __sColorScheme != "|#")
1114 stringSettings[STR_COLORSCHEME] = __sColorScheme;
1115 }
1116 }
1117 else
1118 {
1119 StripSpaces(sTemp);
1120
1121 auto iter = mColorSchemes.find(sTemp);
1122
1123 if (iter != mColorSchemes.end())
1124 stringSettings[STR_COLORSCHEME] = iter->second;
1125 else
1126 stringSettings[STR_COLORSCHEME] = mColorSchemes["std"];
1127 }
1128
1129 if (stringSettings[STR_COLORSCHEME].length() > 32)
1130 stringSettings[STR_COLORSCHEME] = mColorSchemes["std"];
1131
1132 while (stringSettings[STR_COLORSCHEME].find(' ') != std::string::npos)
1133 {
1135 }
1136
1139
1140 for (unsigned int i = 0; i < stringSettings[STR_COLORSCHEME].length(); i++)
1141 {
1142 if (stringSettings[STR_COLORSCHEME][i] == '#' || stringSettings[STR_COLORSCHEME][i] == '|')
1143 {
1146 continue;
1147 }
1148
1149 if (stringSettings[STR_COLORSCHEME][i] == '{'
1150 && i+3 < stringSettings[STR_COLORSCHEME].length()
1151 && stringSettings[STR_COLORSCHEME][i+3] == '}')
1152 {
1157
1158 if (stringSettings[STR_COLORSCHEME][i+2] >= '2' && stringSettings[STR_COLORSCHEME][i+2] <= '8')
1159 {
1161
1162 if (stringSettings[STR_COLORSCHEME][i+2] < '6')
1164 else
1166
1169 }
1170 else
1171 {
1174 }
1175
1176 i += 3;
1177 continue;
1178 }
1179
1186 }
1187 }
1188
1189 if (findParameter(sCmd, "bgcolorscheme", '=') && (nType == ALL || nType & LOCAL))
1190 {
1191 unsigned int nPos = findParameter(sCmd, "bgcolorscheme", '=') + 13;
1192 std::string sTemp = getArgAtPos(__sCmd, nPos, ARGEXTRACT_ASSTRING | ARGEXTRACT_PARSED);
1193
1194 if (sTemp.front() == '"')
1195 {
1196 std::string __sBGColorScheme = removeSurroundingQuotationMarks(sTemp);
1197 StripSpaces(__sBGColorScheme);
1198
1199 if (!checkColorChars(__sBGColorScheme))
1200 stringSettings[STR_BACKGROUNDCOLORSCHEME] = mColorSchemes["std"];
1201 else
1202 {
1203 if (__sBGColorScheme == "#"
1204 && stringSettings[STR_BACKGROUNDCOLORSCHEME].find('#') == std::string::npos)
1206 else if (__sBGColorScheme == "|"
1207 && stringSettings[STR_BACKGROUNDCOLORSCHEME].find('|') == std::string::npos)
1209 else if ((__sBGColorScheme == "#|" || __sBGColorScheme == "|#")
1210 && (stringSettings[STR_BACKGROUNDCOLORSCHEME].find('#') == std::string::npos
1211 || stringSettings[STR_BACKGROUNDCOLORSCHEME].find('|') == std::string::npos))
1212 {
1213 if (stringSettings[STR_BACKGROUNDCOLORSCHEME].find('#') == std::string::npos
1214 && stringSettings[STR_BACKGROUNDCOLORSCHEME].find('|') != std::string::npos)
1216 else if (stringSettings[STR_BACKGROUNDCOLORSCHEME].find('|') == std::string::npos
1217 && stringSettings[STR_BACKGROUNDCOLORSCHEME].find('#') != std::string::npos)
1219 else
1221 }
1222 else if (__sBGColorScheme != "#" && __sBGColorScheme != "|" && __sBGColorScheme != "#|" && __sBGColorScheme != "|#")
1223 stringSettings[STR_BACKGROUNDCOLORSCHEME] = __sBGColorScheme;
1224 }
1225 }
1226 else
1227 {
1228 StripSpaces(sTemp);
1229
1230 auto iter = mColorSchemes.find(sTemp);
1231
1232 if (iter != mColorSchemes.end())
1234 else if (sTemp == "real")
1235 stringSettings[STR_BACKGROUNDCOLORSCHEME] = "<<REALISTIC>>";
1236 else
1237 stringSettings[STR_BACKGROUNDCOLORSCHEME] = mColorSchemes["std"];
1238 }
1239
1240 if (stringSettings[STR_BACKGROUNDCOLORSCHEME].length() > 32)
1241 stringSettings[STR_BACKGROUNDCOLORSCHEME] = mColorSchemes["std"];
1242
1243 while (stringSettings[STR_BACKGROUNDCOLORSCHEME].find(' ') != std::string::npos)
1244 {
1246 }
1247 }
1248
1249 if (findParameter(sCmd, "plotcolors", '=') && (nType == ALL || nType & LOCAL))
1250 {
1251 unsigned int nPos = findParameter(sCmd, "plotcolors", '=')+10;
1252 std::string sTemp = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1253 if (checkColorChars(sTemp))
1254 {
1255 for (unsigned int i = 0; i < sTemp.length(); i++)
1256 {
1257 if (i >= STYLES_COUNT)
1258 break;
1259 if (sTemp[i] == ' ')
1260 continue;
1261 stringSettings[STR_COLORS][i] = sTemp[i];
1262 }
1263 }
1264 }
1265
1266 if (findParameter(sCmd, "axisbind", '=') && (nType == ALL || nType & LOCAL))
1267 {
1268 unsigned int nPos = findParameter(sCmd, "axisbind", '=')+8;
1269 std::string sTemp = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1270 for (unsigned int i = 0; i < sTemp.length(); i++)
1271 {
1272 if (sTemp[i] == 'r' || sTemp[i] == 'l')
1273 {
1274 if (sTemp.length() > i+1 && (sTemp[i+1] == 't' || sTemp[i+1] == 'b'))
1275 {
1276 stringSettings[STR_AXISBIND] += sTemp.substr(i,2);
1277 i++;
1278 }
1279 else if (sTemp.length() > i+1 && (sTemp[i+1] == ' ' || sTemp[i+1] == 'r' || sTemp[i+1] == 'l'))
1280 {
1281 stringSettings[STR_AXISBIND] += sTemp.substr(i,1) + "b";
1282 if (sTemp[i+1] == ' ')
1283 i++;
1284 }
1285 else if (sTemp.length() == i+1)
1286 stringSettings[STR_AXISBIND] += sTemp.substr(i) + "b";
1287 else
1289 }
1290 else if (sTemp[i] == 't' || sTemp[i] == 'b')
1291 {
1292 if (sTemp.length() > i+1 && (sTemp[i+1] == 'l' || sTemp[i+1] == 'r'))
1293 {
1294 stringSettings[STR_AXISBIND] += sTemp.substr(i+1,1) + sTemp.substr(i,1);
1295 i++;
1296 }
1297 else if (sTemp.length() > i+1 && (sTemp[i+1] == ' ' || sTemp[i+1] == 't' || sTemp[i+1] == 'b'))
1298 {
1299 stringSettings[STR_AXISBIND] += "l" + sTemp.substr(i,1);
1300 if (sTemp[i+1] == ' ')
1301 i++;
1302 }
1303 else if (sTemp.length() == i+1)
1304 stringSettings[STR_AXISBIND] += "l" + sTemp.substr(i);
1305 else
1307 }
1308 else if (sTemp.substr(i,2) == " ")
1309 {
1311 i++;
1312 }
1313 }
1314 if (stringSettings[STR_AXISBIND].find('l') == std::string::npos && stringSettings[STR_AXISBIND].length())
1315 {
1316 for (unsigned int i = 0; i < stringSettings[STR_AXISBIND].length(); i++)
1317 {
1318 if (stringSettings[STR_AXISBIND][i] == 'r')
1319 stringSettings[STR_AXISBIND][i] = 'l';
1320 }
1321 }
1322 if (stringSettings[STR_AXISBIND].find('b') == std::string::npos && stringSettings[STR_AXISBIND].length())
1323 {
1324 for (unsigned int i = 0; i < stringSettings[STR_AXISBIND].length(); i++)
1325 {
1326 if (stringSettings[STR_AXISBIND][i] == 't')
1327 stringSettings[STR_AXISBIND][i] = 'b';
1328 }
1329 }
1330 }
1331
1332 if (findParameter(sCmd, "linestyles", '=') && (nType == ALL || nType & LOCAL))
1333 {
1334 unsigned int nPos = findParameter(sCmd, "linestyles", '=')+10;
1335 std::string sTemp = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1336 if (checkLineChars(sTemp))
1337 {
1338 for (unsigned int i = 0; i < sTemp.length(); i++)
1339 {
1340 if (i >= STYLES_COUNT)
1341 break;
1342 if (sTemp[i] == ' ')
1343 continue;
1344 stringSettings[STR_LINESTYLES][i] = sTemp[i];
1345 stringSettings[STR_LINESTYLESGREY][i] = sTemp[i];
1346 }
1347 }
1348 }
1349
1350 if (findParameter(sCmd, "linesizes", '=') && (nType == ALL || nType & LOCAL))
1351 {
1352 unsigned int nPos = findParameter(sCmd, "linesizes", '=')+9;
1353 std::string sTemp = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1354
1355 for (unsigned int i = 0; i < sTemp.length(); i++)
1356 {
1357 if (i >= STYLES_COUNT)
1358 break;
1359 if (sTemp[i] == ' ')
1360 continue;
1361 if (sTemp[i] < '0' || sTemp[i] > '9')
1362 continue;
1363 stringSettings[STR_LINESIZES][i] = sTemp[i];
1364 }
1365
1366 }
1367
1368 if (findParameter(sCmd, "pointstyles", '=') && (nType == ALL || nType & LOCAL))
1369 {
1370 unsigned int nPos = findParameter(sCmd, "pointstyles", '=')+11;
1371 std::string sTemp = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1372 if (checkPointChars(sTemp))
1373 {
1374 int nChar = 0;
1375 std::string sChar = "";
1376 for (unsigned int i = 0; i < sTemp.length(); i++)
1377 {
1378 sChar = "";
1379 if (i >= 2*STYLES_COUNT || nChar >= STYLES_COUNT)
1380 break;
1381 if (sTemp[i] == ' ')
1382 {
1383 nChar++;
1384 continue;
1385 }
1386 if (sTemp[i] == '#' && i+1 < sTemp.length() && sTemp[i+1] != ' ')
1387 {
1388 sChar = "#";
1389 i++;
1390 sChar += sTemp[i];
1391 stringSettings[STR_POINTSTYLES].replace(2*nChar, 2, sChar);
1392 nChar++;
1393 continue;
1394 }
1395 if (sTemp[i] != '#')
1396 {
1397 sChar = " ";
1398 sChar += sTemp[i];
1399 stringSettings[STR_POINTSTYLES].replace(2*nChar, 2, sChar);
1400 nChar++;
1401 }
1402 }
1403 }
1404 }
1405
1406 if (findParameter(sCmd, "styles", '=') && (nType == ALL || nType & LOCAL))
1407 {
1408 unsigned int nPos = findParameter(sCmd, "styles", '=')+6;
1409 std::string sTemp = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1410 unsigned int nJump = 0;
1411 unsigned int nStyle = 0;
1412 for (unsigned int i = 0; i < sTemp.length(); i += 4)
1413 {
1414 nJump = 0;
1415 if (nStyle >= STYLES_COUNT)
1416 break;
1417 if (sTemp.substr(i,4).find('#') != std::string::npos)
1418 nJump = 1;
1419 for (unsigned int j = 0; j < 4+nJump; j++)
1420 {
1421 if (i+j >= sTemp.length())
1422 break;
1423 if (sTemp[i+j] == ' ')
1424 continue;
1425 if (sTemp[i+j] >= '0' && sTemp[i+j] <= '9')
1426 {
1427 stringSettings[STR_LINESIZES][nStyle] = sTemp[i+j];
1428 continue;
1429 }
1430 if (sTemp[i+j] == '#' && i+j+1 < sTemp.length() && checkPointChars(sTemp.substr(i+j,2)))
1431 {
1432 stringSettings[STR_POINTSTYLES][2*nStyle] = '#';
1433 if (sTemp[i+j+1] != ' ')
1434 stringSettings[STR_POINTSTYLES][2*nStyle+1] = sTemp[i+j+1];
1435 j++;
1436 continue;
1437 }
1438 else if (sTemp[i+j] == '#')
1439 continue;
1440 if (checkPointChars(sTemp.substr(i+j,1)))
1441 {
1442 stringSettings[STR_POINTSTYLES][2*nStyle] = ' ';
1443 stringSettings[STR_POINTSTYLES][2*nStyle+1] = sTemp[i+j];
1444 continue;
1445 }
1446 if (checkColorChars(sTemp.substr(i+j,1)))
1447 {
1448 stringSettings[STR_COLORS][nStyle] = sTemp[i+j];
1449 continue;
1450 }
1451 if (checkLineChars(sTemp.substr(i+j,1)))
1452 {
1453 stringSettings[STR_LINESTYLES][nStyle] = sTemp[i+j];
1454 stringSettings[STR_LINESTYLESGREY][nStyle] = sTemp[i+j];
1455 continue;
1456 }
1457 }
1458 nStyle++;
1459 i += nJump;
1460 }
1461 }
1462
1463 if (findParameter(sCmd, "gridstyle", '=') && (nType == ALL || nType & GLOBAL))
1464 {
1465 unsigned int nPos = findParameter(sCmd, "gridstyle", '=')+9;
1466 std::string sTemp = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1467 for (unsigned int i = 0; i < sTemp.length(); i += 3)
1468 {
1469 for (unsigned int j = 0; j < 3; j++)
1470 {
1471 if (i+j >= sTemp.length())
1472 break;
1473 if (sTemp[i+j] == ' ')
1474 continue;
1475 if (sTemp[i+j] >= '0' && sTemp[i+j] <= '9')
1476 {
1477 stringSettings[STR_GRIDSTYLE][2+i] = sTemp[i+j];
1478 continue;
1479 }
1480 if (sTemp[i+j] == '#')
1481 continue;
1482 if (checkPointChars(sTemp.substr(i+j,1)))
1483 {
1484 continue;
1485 }
1486 if (checkColorChars(sTemp.substr(i+j,1)))
1487 {
1488 stringSettings[STR_GRIDSTYLE][i] = sTemp[i+j];
1489 continue;
1490 }
1491 if (checkLineChars(sTemp.substr(i+j,1)))
1492 {
1493 stringSettings[STR_GRIDSTYLE][i+1] = sTemp[i+j];
1494 continue;
1495 }
1496 }
1497 }
1498 }
1499
1500 if (findParameter(sCmd, "legendstyle", '=') && (nType == ALL || nType & LOCAL))
1501 {
1502 if (getArgAtPos(sCmd, findParameter(sCmd, "legendstyle", '=')+11) == "onlycolors")
1504 else if (getArgAtPos(sCmd, findParameter(sCmd, "legendstyle", '=')+11) == "onlystyles")
1506 else
1508 }
1509
1510 if (findParameter(sCmd, "coords", '=') && (nType == ALL || nType & GLOBAL))
1511 {
1512 int nPos = findParameter(sCmd, "coords", '=')+6;
1513 std::string sCoords = getArgAtPos(sCmd, nPos);
1514
1515 if (sCoords.find('-') != std::string::npos)
1516 sCoords.erase(sCoords.find('-'));
1517
1518 if (sCoords == "cartesian" || sCoords == "std")
1520 else if (sCoords == "polar" || sCoords == "polar_pz" || sCoords == "cylindrical")
1522 else if (sCoords == "polar_rp")
1524 else if (sCoords == "polar_rz")
1526 else if (sCoords == "spherical" || sCoords == "spherical_pt")
1528 else if (sCoords == "spherical_rp")
1530 else if (sCoords == "spherical_rt")
1532 }
1533
1534 if (findParameter(sCmd, "coords", '=') && (nType == ALL || nType & LOCAL))
1535 {
1536 int nPos = findParameter(sCmd, "coords", '=')+6;
1537 std::string sCoords = getArgAtPos(sCmd, nPos);
1538
1539 if (sCoords.find('-') != std::string::npos)
1540 sCoords.erase(0, sCoords.find('-')+1);
1541
1542 if (sCoords == "parametric")
1544 }
1545
1546 if (findParameter(sCmd, "font", '=') && (nType == ALL || nType & SUPERGLOBAL))
1547 {
1548 std::string sTemp = getArgAtPos(sCmd, findParameter(sCmd, "font", '=')+4);
1549 StripSpaces(sTemp);
1550
1551 if (sTemp == "palatino")
1552 sTemp = "pagella";
1553
1554 if (sTemp == "times")
1555 sTemp = "termes";
1556
1557 if (sTemp == "bookman")
1558 sTemp = "bonum";
1559
1560 if (sTemp == "avantgarde")
1561 sTemp = "adventor";
1562
1563 if (sTemp == "chancery")
1564 sTemp = "chorus";
1565
1566 if (sTemp == "courier")
1567 sTemp = "cursor";
1568
1569 if (sTemp == "helvetica")
1570 sTemp = "heros";
1571
1572 if (sTemp != stringSettings[STR_FONTSTYLE]
1573 && (sTemp == "pagella"
1574 || sTemp == "adventor"
1575 || sTemp == "bonum"
1576 || sTemp == "chorus"
1577 || sTemp == "cursor"
1578 || sTemp == "heros"
1579 || sTemp == "heroscn"
1580 || sTemp == "schola"
1581 || sTemp == "termes")
1582 )
1583 {
1585 _fontData.LoadFont(stringSettings[STR_FONTSTYLE].c_str(), (sTokens[0][1]+ "\\fonts").c_str());
1586 }
1587 }
1588
1589 if ((findParameter(sCmd, "opng", '=')
1590 || findParameter(sCmd, "save", '=')
1591 || findParameter(sCmd, "export", '=')
1592 || findParameter(sCmd, "opnga", '=')
1593 || findParameter(sCmd, "oeps", '=')
1594 || findParameter(sCmd, "obps", '=')
1595 || findParameter(sCmd, "osvg", '=')
1596 || findParameter(sCmd, "otex", '=')
1597 || findParameter(sCmd, "otif", '=')
1598 || findParameter(sCmd, "ogif", '=')) && (nType == ALL || nType & SUPERGLOBAL))
1599 {
1600 unsigned int nPos = 0;
1601
1602 if (findParameter(sCmd, "opng", '='))
1603 nPos = findParameter(sCmd, "opng", '=') + 4;
1604 else if (findParameter(sCmd, "opnga", '='))
1605 nPos = findParameter(sCmd, "opnga", '=') + 5;
1606 else if (findParameter(sCmd, "save", '='))
1607 nPos = findParameter(sCmd, "save", '=') + 4;
1608 else if (findParameter(sCmd, "export", '='))
1609 nPos = findParameter(sCmd, "export", '=') + 6;
1610 else if (findParameter(sCmd, "oeps", '='))
1611 nPos = findParameter(sCmd, "oeps", '=') + 4;
1612 else if (findParameter(sCmd, "obps", '='))
1613 nPos = findParameter(sCmd, "obps", '=') + 4;
1614 else if (findParameter(sCmd, "osvg", '='))
1615 nPos = findParameter(sCmd, "osvg", '=') + 4;
1616 else if (findParameter(sCmd, "otex", '='))
1617 nPos = findParameter(sCmd, "otex", '=') + 4;
1618 else if (findParameter(sCmd, "otif", '='))
1619 nPos = findParameter(sCmd, "otif", '=') + 4;
1620 else if (findParameter(sCmd, "ogif", '='))
1621 nPos = findParameter(sCmd, "ogif", '=') + 4;
1622
1623 stringSettings[STR_FILENAME] = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1625
1626 if (stringSettings[STR_FILENAME].length())
1627 {
1628 std::string sExtension = "";
1629
1630 if (stringSettings[STR_FILENAME].length() > 4)
1631 sExtension = stringSettings[STR_FILENAME].substr(stringSettings[STR_FILENAME].length()-4,4);
1632
1633 if (sExtension != ".png"
1634 && (findParameter(sCmd, "opng", '=')
1635 || findParameter(sCmd, "opnga", '=')))
1636 stringSettings[STR_FILENAME] += ".png";
1637 else if (sExtension != ".eps" && findParameter(sCmd, "oeps", '='))
1638 stringSettings[STR_FILENAME] += ".eps";
1639 else if (sExtension != ".bps" && findParameter(sCmd, "obps", '='))
1640 stringSettings[STR_FILENAME] += ".bps";
1641 else if (sExtension != ".svg" && findParameter(sCmd, "osvg", '='))
1642 stringSettings[STR_FILENAME] += ".svg";
1643 else if (sExtension != ".tex" && findParameter(sCmd, "otex", '='))
1644 stringSettings[STR_FILENAME] += ".tex";
1645 else if (sExtension != ".tif" && sExtension != ".tiff" && findParameter(sCmd, "otif", '='))
1646 stringSettings[STR_FILENAME] += ".tiff";
1647 else if (sExtension != ".gif" && findParameter(sCmd, "ogif", '='))
1648 stringSettings[STR_FILENAME] += ".gif";
1649 else if ((findParameter(sCmd, "export", '=') || findParameter(sCmd, "save", '='))
1650 && stringSettings[STR_FILENAME].rfind('.') == std::string::npos)
1651 stringSettings[STR_FILENAME] += ".png";
1652
1654 }
1655 }
1656
1657 if ((findParameter(sCmd, "xlabel", '=')
1658 || findParameter(sCmd, "ylabel", '=')
1659 || findParameter(sCmd, "zlabel", '=')
1660 || findParameter(sCmd, "title", '=')
1661 || findParameter(sCmd, "background", '=')) && (nType == ALL || nType & GLOBAL))
1662 {
1663 int nPos = 0;
1664
1665 if (findParameter(sCmd, "xlabel", '='))
1666 {
1667 nPos = findParameter(sCmd, "xlabel", '=') + 6;
1668 sAxisLabels[0] = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1669 bDefaultAxisLabels[0] = false;
1670 }
1671
1672 if (findParameter(sCmd, "ylabel", '='))
1673 {
1674 nPos = findParameter(sCmd, "ylabel", '=') + 6;
1675 sAxisLabels[1] = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1676 bDefaultAxisLabels[1] = false;
1677 }
1678
1679 if (findParameter(sCmd, "zlabel", '='))
1680 {
1681 nPos = findParameter(sCmd, "zlabel", '=') + 6;
1682 sAxisLabels[2] = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1683 bDefaultAxisLabels[2] = false;
1684 }
1685
1686 if (findParameter(sCmd, "title", '='))
1687 {
1688 nPos = findParameter(sCmd, "title", '=') + 5;
1689 stringSettings[STR_PLOTTITLE] = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1691
1692 if (stringSettings[STR_COMPOSEDTITLE].length())
1694 else
1696 }
1697
1698 if (findParameter(sCmd, "background", '='))
1699 {
1700 nPos = findParameter(sCmd, "background", '=')+10;
1701 stringSettings[STR_BACKGROUND] = getArgAtPos(__sCmd, nPos, STRINGEXTRACT);
1703
1704 if (stringSettings[STR_BACKGROUND].length())
1705 {
1706 if (stringSettings[STR_BACKGROUND].find('.') == std::string::npos)
1707 stringSettings[STR_BACKGROUND] += ".png";
1708 else if (stringSettings[STR_BACKGROUND].substr(stringSettings[STR_BACKGROUND].rfind('.')) != ".png")
1710
1711 if (stringSettings[STR_BACKGROUND].length())
1713 }
1714 }
1715
1716 for (int i = 0; i < 3; i++)
1717 {
1719 }
1720 }
1721
1722 if ((findParameter(sCmd, "xticks", '=')
1723 || findParameter(sCmd, "yticks", '=')
1724 || findParameter(sCmd, "zticks", '=')
1725 || findParameter(sCmd, "cticks", '=')) && (nType == ALL || nType & GLOBAL))
1726 {
1727 int nPos = 0;
1728
1729 if ((nPos = findParameter(sCmd, "xticks", '=')))
1730 {
1731 sTickTemplate[0] = getArgAtPos(__sCmd, nPos+6, STRINGEXTRACT);
1732
1733 if (sTickTemplate[0].find('%') == std::string::npos && sTickTemplate[0].length())
1734 sTickTemplate[0] += "%g";
1735 }
1736
1737 if ((nPos = findParameter(sCmd, "yticks", '=')))
1738 {
1739 sTickTemplate[1] = getArgAtPos(__sCmd, nPos+6, STRINGEXTRACT);
1740
1741 if (sTickTemplate[1].find('%') == std::string::npos && sTickTemplate[1].length())
1742 sTickTemplate[1] += "%g";
1743 }
1744
1745 if ((nPos = findParameter(sCmd, "zticks", '=')))
1746 {
1747 sTickTemplate[2] = getArgAtPos(__sCmd, nPos+6, STRINGEXTRACT);
1748
1749 if (sTickTemplate[2].find('%') == std::string::npos && sTickTemplate[2].length())
1750 sTickTemplate[2] += "%g";
1751 }
1752
1753 if ((nPos = findParameter(sCmd, "cticks", '=')))
1754 {
1755 sTickTemplate[3] = getArgAtPos(__sCmd, nPos+6, STRINGEXTRACT);
1756
1757 if (sTickTemplate[3].find('%') == std::string::npos && sTickTemplate[3].length())
1758 sTickTemplate[3] += "%g";
1759 }
1760 }
1761
1762 if ((findParameter(sCmd, "xscale", '=')
1763 || findParameter(sCmd, "yscale", '=')
1764 || findParameter(sCmd, "zscale", '=')
1765 || findParameter(sCmd, "cscale", '=')) && (nType == ALL || nType & GLOBAL))
1766 {
1767 int nPos = 0;
1768
1769 if ((nPos = findParameter(sCmd, "xscale", '=')))
1770 {
1771 _parser.SetExpr(getArgAtPos(__sCmd, nPos+6));
1772 dAxisScale[0] = _parser.Eval().real();
1773 }
1774
1775 if ((nPos = findParameter(sCmd, "yscale", '=')))
1776 {
1777 _parser.SetExpr(getArgAtPos(__sCmd, nPos+6));
1778 dAxisScale[1] = _parser.Eval().real();
1779 }
1780
1781 if ((nPos = findParameter(sCmd, "zscale", '=')))
1782 {
1783 _parser.SetExpr(getArgAtPos(__sCmd, nPos+6));
1784 dAxisScale[2] = _parser.Eval().real();
1785 }
1786
1787 if ((nPos = findParameter(sCmd, "cscale", '=')))
1788 {
1789 _parser.SetExpr(getArgAtPos(__sCmd, nPos+6));
1790 dAxisScale[3] = _parser.Eval().real();
1791 }
1792
1793 for (int i = 0; i < 4; i++)
1794 {
1795 if (dAxisScale[i] == 0)
1796 dAxisScale[i] = 1.0;
1797 }
1798 }
1799
1800 if ((findParameter(sCmd, "xticklabels", '=')
1801 || findParameter(sCmd, "yticklabels", '=')
1802 || findParameter(sCmd, "zticklabels", '=')
1803 || findParameter(sCmd, "cticklabels", '=')) && (nType == ALL || nType & GLOBAL))
1804 {
1805 int nPos = 0;
1806
1807 if ((nPos = findParameter(sCmd, "xticklabels", '=')))
1808 sCustomTicks[0] = getArgAtPos(__sCmd, nPos+11, STRINGEXTRACT);
1809
1810 if ((nPos = findParameter(sCmd, "yticklabels", '=')))
1811 sCustomTicks[1] = getArgAtPos(__sCmd, nPos+11, STRINGEXTRACT);
1812
1813 if ((nPos = findParameter(sCmd, "zticklabels", '=')))
1814 sCustomTicks[2] = getArgAtPos(__sCmd, nPos+11, STRINGEXTRACT);
1815
1816 if ((nPos = findParameter(sCmd, "cticklabels", '=')))
1817 sCustomTicks[3] = getArgAtPos(__sCmd, nPos+11, STRINGEXTRACT);
1818 }
1819
1820 if (sCmd.find('[') != std::string::npos && (nType == ALL || nType & GLOBAL))
1821 {
1822 unsigned int nPos = 0;
1823
1824 do
1825 {
1826 nPos = sCmd.find('[', nPos);
1827 if (nPos == std::string::npos)
1828 break;
1829 nPos++;
1830 }
1831 while (isInQuotes(sCmd, nPos));
1832
1833 if (nPos != std::string::npos && sCmd.find(']', nPos) != std::string::npos)
1834 {
1835 auto args = getAllArguments(__sCmd.substr(nPos, sCmd.find(']', nPos) - nPos));
1836
1837 for (size_t i = 0; i < args.size(); i++)
1838 {
1839 if (i > 4)
1840 break;
1841
1842 if (args[i].find(':') == std::string::npos || args[i] == ":")
1843 continue;
1844
1845 ranges[i].reset(args[i]);
1846
1847 if (i < 4)
1848 {
1849 bRanges[i] = true;
1850 nRanges = i+1;
1851
1852 if (ranges[i].front().real() > ranges[i].back().real())
1853 {
1854 bMirror[i] = true;
1855 ranges[i].reset(ranges[i].back(), ranges[i].front());
1856 }
1857 }
1858 }
1859
1860 // Do not perform this logic for CRANGE and TRANGE
1861 for (size_t i = 0; i <= ZRANGE; i++)
1862 {
1863 if (!bRanges[i])
1864 continue;
1865
1866 if (isinf(ranges[i].front()) || isnan(ranges[i].front()))
1867 ranges[i].reset(-10.0, ranges[i].back());
1868
1869 if (isinf(ranges[i].back()) || isnan(ranges[i].back()))
1870 ranges[i].reset(ranges[i].front(), 10.0);
1871 }
1872
1873 for (int n = nRanges-1; n >= 0; n--)
1874 {
1875 if (bRanges[n])
1876 break;
1877
1878 if (!bRanges[n])
1879 nRanges--;
1880 }
1881 }
1882 }
1883 else if (nType == ALL || nType & GLOBAL)
1884 nRanges = 0;
1885
1886 return;
1887}
1888
1889
1898{
1899 _lVLines.clear();
1900 _lHlines.clear();
1901
1902 ranges.intervals.clear();
1903 ranges.intervals.resize(3, Interval(-10.0, 10.0));
1904 ranges.intervals.push_back(Interval(NAN, NAN));
1905 ranges.intervals.push_back(Interval(0, 1.0));
1906
1907 ranges.setNames({"x", "y", "z", "c", "t"});
1908
1909 for (int i = XRANGE; i <= ZRANGE; i++)
1910 {
1911 dOrigin[i] = 0.0;
1912 sAxisLabels[i] = "";
1913 bDefaultAxisLabels[i] = true;
1914 _lHlines.push_back(Line());
1915 _lVLines.push_back(Line());
1916 nSlices[i] = 1;
1917 }
1918
1919 for (int i = XRANGE; i <= CRANGE; i++)
1920 {
1921 bRanges[i] = false;
1922 bMirror[i] = false;
1923 bLogscale[i] = false;
1924 sTickTemplate[i] = "";
1925 sCustomTicks[i] = "";
1926 dAxisScale[i] = 1.0;
1927 _timeAxes[i].deactivate();
1928 }
1929
1930 for (int i = XRANGE; i <= YRANGE; i++)
1931 {
1932 _AddAxes[i].ivl.reset(NAN, NAN);
1933 _AddAxes[i].sLabel = "";
1935 }
1936
1937 for (size_t i = 0; i < LOG_SETTING_SIZE; i++)
1938 {
1939 logicalSettings[i] = false;
1940 }
1941
1944
1945 for (size_t i = 0; i < INT_SETTING_SIZE; i++)
1946 {
1947 intSettings[i] = 0;
1948 }
1949
1951 intSettings[INT_SAMPLES] = 100;
1955
1956 for (size_t i = 0; i < FLOAT_SETTING_SIZE; i++)
1957 {
1958 floatSettings[i] = 0.0;
1959 }
1960
1961 floatSettings[FLOAT_ASPECT] = 4.0/3.0;
1964
1965 for (size_t i = 0; i < STR_SETTING_SIZE; i++)
1966 {
1967 stringSettings[i].clear();
1968 }
1969
1970 stringSettings[STR_COLORSCHEME] = "UNC{e4}y";
1971 stringSettings[STR_COLORSCHEMEMEDIUM] = "{U4}{N4}{C4}{e3}{y4}";
1972 stringSettings[STR_COLORSCHEMELIGHT] = "{U8}{N8}{C8}{e7}{y8}";
1973 stringSettings[STR_BACKGROUNDCOLORSCHEME] = "<<REALISTIC>>";
1974 stringSettings[STR_COLORS] = "rbGqmPunclRBgQMpUNCL";
1975 stringSettings[STR_CONTCOLORS] = "kUHYPCQNLMhuWypcqnlm";
1976 stringSettings[STR_CONTGREYS] = "kwkwkwkwkwkwkwkwkwkw";
1977 stringSettings[STR_POINTSTYLES] = " + x o s . d#+#x#.#* x o s . d#+#x#.#* +";
1978 stringSettings[STR_LINESTYLES] = "----------;;;;;;;;;;";
1979 stringSettings[STR_LINESIZES] = "00000000000000000000";
1980 stringSettings[STR_GREYS] = "kHhWkHhWkHhWkHhWkHhW";
1981 stringSettings[STR_LINESTYLESGREY] = "-|=;i:j|=;i:j-|=:i;-";
1982 stringSettings[STR_GRIDSTYLE] = "=h0-h0";
1983
1984 dRotateAngles[0] = 60;
1985 dRotateAngles[1] = 115;
1986 nTargetGUI[0] = -1;
1987 nTargetGUI[1] = -1;
1988 nRanges = 0;
1989 nRequestedLayers = 1;
1990
1992 {
1993 if (stringSettings[STR_FONTSTYLE] != NumeReKernel::getInstance()->getSettings().getDefaultPlotFont())
1995 }
1996 else
1997 stringSettings[STR_FONTSTYLE] = "pagella";
1998
1999 _fontData.LoadFont(stringSettings[STR_FONTSTYLE].c_str(), (sTokens[0][1] + "\\fonts").c_str());
2000}
2001
2002
2011void PlotData::deleteData(bool bGraphFinished /* = false*/)
2012{
2013 _lHlines.clear();
2014 _lVLines.clear();
2015
2016 for (int i = XRANGE; i <= ZRANGE; i++)
2017 {
2018 ranges[i].reset(-10.0, 10.0);
2019 sAxisLabels[i] = "";
2020 bDefaultAxisLabels[i] = true;
2021 _lHlines.push_back(Line());
2022 _lVLines.push_back(Line());
2023 }
2024
2025 ranges[CRANGE].reset(NAN, NAN);
2026
2027 for (int i = XRANGE; i <= CRANGE; i++)
2028 {
2029 bRanges[i] = false;
2030 bMirror[i] = false;
2031 sCustomTicks[i] = "";
2032 dAxisScale[i] = 1.0;
2033 _timeAxes[i].deactivate();
2034 }
2035
2036 nRanges = 0;
2037
2038 if (bGraphFinished)
2039 {
2041 nTargetGUI[0] = -1;
2042 nTargetGUI[1] = -1;
2043 }
2044
2047
2049 nRequestedLayers = 1;
2051
2052 stringSettings[STR_COLORS] = "rbGqmPunclRBgQMpUNCL";
2053 stringSettings[STR_CONTCOLORS] = "kUHYPCQNLMhuWypcqnlm";
2054 stringSettings[STR_CONTGREYS] = "kwkwkwkwkwkwkwkwkwkw";
2055 stringSettings[STR_POINTSTYLES] = " + x o s . d#+#x#.#* x o s . d#+#x#.#* +";
2056 stringSettings[STR_LINESTYLES] = "----------;;;;;;;;;;";
2057 stringSettings[STR_LINESIZES] = "00000000000000000000";
2058 stringSettings[STR_GREYS] = "kHhWkHhWkHhWkHhWkHhW";
2059 stringSettings[STR_LINESTYLESGREY] = "-|=;i:j|=;i:j-|=:i;-";
2064
2065 for (int i = XRANGE; i <= YRANGE; i++)
2066 {
2067 _AddAxes[i].ivl.reset(NAN, NAN);
2068 _AddAxes[i].sLabel = "";
2070 }
2071}
2072
2073
2084std::string PlotData::getParams(bool asstr) const
2085{
2086 const Settings& _option = NumeReKernel::getInstance()->getSettings();
2087 std::string sReturn = "";
2088 std::string sSepString = "; ";
2089 static std::map<std::string,std::pair<PlotData::LogicalPlotSetting,PlotData::ParamType>> mGenericSwitches = getGenericSwitches();
2090 static std::map<std::string,std::string> mColorSchemes = getColorSchemes();
2091
2092 if (asstr)
2093 {
2094 sReturn = "\"";
2095 sSepString = "\", \"";
2096 }
2097
2098 sReturn += "[";
2099
2100 for (size_t i = XRANGE; i <= TRANGE; i++)
2101 {
2102 sReturn += toString(ranges[i].front(), _option.getPrecision()) + ":" + toString(ranges[i].back(), _option.getPrecision());
2103
2104 if (i < TRANGE)
2105 sReturn += ", ";
2106 }
2107
2108 sReturn += "]" + sSepString;
2109
2110 // Handle generic switches first
2111 for (const auto& iter : mGenericSwitches)
2112 {
2113 if (logicalSettings[iter.second.first] && iter.first != "reconstruct")
2114 sReturn += iter.first + sSepString;
2115 }
2116
2118 sReturn += "alpha" + sSepString;
2119
2121 sReturn += "animate [" + toString(intSettings[INT_ANIMATESAMPLES]) + " frames]" + sSepString;
2122
2123 sReturn += "aspect=" + toString(floatSettings[FLOAT_ASPECT], 4) + sSepString;
2124
2125 if (stringSettings[STR_AXISBIND].length())
2126 {
2127 sReturn += "axisbind=";
2128 if (asstr)
2129 sReturn += "\\\"" + stringSettings[STR_AXISBIND] + "\\\"";
2130 else
2131 sReturn += "\"" + stringSettings[STR_AXISBIND] + "\"";
2132 sReturn += sSepString;
2133 }
2134
2135 sReturn += "axisscale=[";
2136
2137 for (int i = 0; i < 4; i++)
2138 {
2139 sReturn += toString(dAxisScale[i], _option);
2140 if (i < 3)
2141 sReturn += ", ";
2142 }
2143
2144 sReturn += "]" + sSepString;
2145
2147 sReturn += "bars=" + toString(floatSettings[FLOAT_BARS], 4) + sSepString;
2148
2149 if (stringSettings[STR_BACKGROUND].length())
2150 {
2151 if (asstr)
2152 sReturn += "background=\\\"" + stringSettings[STR_BACKGROUND] + "\\\"" + sSepString;
2153 else
2154 sReturn += "background=\"" + stringSettings[STR_BACKGROUND] + "\"" + sSepString;
2155 }
2156
2157 sReturn += "bgcolorscheme=";
2158
2159 if (stringSettings[STR_BACKGROUNDCOLORSCHEME] == "<<REALISTIC>>")
2160 sReturn += "real" + sSepString;
2161 else
2162 {
2163 bool found = false;
2164
2165 for (const auto& iter : mColorSchemes)
2166 {
2167 if (iter.second == stringSettings[STR_BACKGROUNDCOLORSCHEME])
2168 {
2169 sReturn += iter.first + sSepString;
2170 found = true;
2171 break;
2172 }
2173 }
2174
2175 if (!found)
2176 {
2177 if (asstr)
2178 sReturn += "\\\"" + stringSettings[STR_BACKGROUNDCOLORSCHEME] + "\\\"" + sSepString;
2179 else
2180 sReturn += "\"" + stringSettings[STR_BACKGROUNDCOLORSCHEME] + "\"" + sSepString;
2181 }
2182 }
2183
2184 sReturn += "colorscheme=";
2185
2186 {
2187 bool found = false;
2188
2189 for (const auto& iter : mColorSchemes)
2190 {
2191 if (iter.second == stringSettings[STR_COLORSCHEME])
2192 {
2193 sReturn += iter.first + sSepString;
2194 found = true;
2195 break;
2196 }
2197 }
2198
2199 if (!found)
2200 {
2201 if (asstr)
2202 sReturn += "\\\"" + stringSettings[STR_COLORSCHEME] + "\\\"" + sSepString;
2203 else
2204 sReturn += "\"" + stringSettings[STR_COLORSCHEME] + "\"" + sSepString;
2205 }
2206 }
2207
2208
2210 sReturn += "complexmode=reim" + sSepString;
2212 sReturn += "complexmode=plane" + sSepString;
2213
2214 if (intSettings[INT_COORDS] >= 100)
2215 sReturn += "spherical coords" + sSepString;
2216 else if (intSettings[INT_COORDS] >= 10)
2217 sReturn += "polar coords" + sSepString;
2218
2220 sReturn += "flow" + sSepString;
2221
2222 sReturn += "font="+stringSettings[STR_FONTSTYLE]+sSepString;
2223
2224 if (intSettings[INT_GRID] == 1)
2225 sReturn += "grid=coarse" + sSepString;
2226 else if (intSettings[INT_GRID] == 2)
2227 sReturn += "grid=fine" + sSepString;
2228
2229 sReturn += "gridstyle=";
2230
2231 if (asstr)
2232 sReturn += "\\\"" + stringSettings[STR_GRIDSTYLE] + "\\\"";
2233 else
2234 sReturn += "\"" + stringSettings[STR_GRIDSTYLE] + "\"";
2235
2236 sReturn += sSepString;
2237
2239 sReturn += "hbars=" + toString(floatSettings[FLOAT_HBARS], 4) + sSepString;
2240
2242 sReturn += "lcont" + sSepString;
2243
2244 sReturn += "legend=";
2245
2247 sReturn += "bottomleft";
2248 else if (intSettings[INT_LEGENDPOSITION] == 1)
2249 sReturn += "bottomright";
2250 else if (intSettings[INT_LEGENDPOSITION] == 2)
2251 sReturn += "topleft";
2252 else
2253 sReturn += "topright";
2254
2255 sReturn += sSepString;
2256
2257 if (intSettings[INT_LEGENDSTYLE] == 1)
2258 sReturn += "legendstyle=onlycolors" + sSepString;
2259
2260 if (intSettings[INT_LEGENDSTYLE] == 2)
2261 sReturn += "legendstyle=onlystyles" + sSepString;
2262
2263 if (intSettings[INT_LIGHTING] == 1)
2264 sReturn += "lighting" + sSepString;
2265
2266 if (intSettings[INT_LIGHTING] == 2)
2267 sReturn += "lighting=smooth" + sSepString;
2268
2269 if (asstr)
2270 sReturn += "linesizes=\\\"" + stringSettings[STR_LINESIZES] + "\\\"" + sSepString;
2271 else
2272 sReturn += "linesizes=\"" + stringSettings[STR_LINESIZES] + "\"" + sSepString;
2273
2274 if (asstr)
2275 sReturn += "linestyles=\\\"" + stringSettings[STR_LINESTYLES] + "\\\"" + sSepString;
2276 else
2277 sReturn += "linestyles=\"" + stringSettings[STR_LINESTYLES] + "\"" + sSepString;
2278
2279 if (bLogscale[0] && bLogscale[1] && bLogscale[2] && bLogscale[3])
2280 sReturn += "logscale" + sSepString;
2281 else
2282 {
2283 if (bLogscale[0])
2284 sReturn += "xlog" + sSepString;
2285 if (bLogscale[1])
2286 sReturn += "ylog" + sSepString;
2287 if (bLogscale[2])
2288 sReturn += "zlog" + sSepString;
2289 if (bLogscale[3])
2290 sReturn += "clog" + sSepString;
2291 }
2292
2294 sReturn += "marks=" + toString(intSettings[INT_MARKS]) + sSepString;
2295
2296 sReturn += "origin=";
2297
2298 if (isnan(dOrigin[0]) && isnan(dOrigin[1]) && isnan(dOrigin[2]))
2299 sReturn += "sliding" + sSepString;
2300 else if (dOrigin[0] == 0.0 && dOrigin[1] == 0.0 && dOrigin[2] == 0.0)
2301 sReturn += "std" + sSepString;
2302 else
2303 sReturn += "[" + toString(dOrigin[0], _option) + ", " + toString(dOrigin[1], _option) + ", " + toString(dOrigin[2], _option) + "]" + sSepString;
2304
2305 sReturn += "slices=[" +toString((int)nSlices[0]) + ", " + toString((int)nSlices[1]) + ", " + toString((int)nSlices[2]) + "]" + sSepString;
2306
2308 sReturn += "pcont" + sSepString;
2309
2311 sReturn += "perspective=" + toString(floatSettings[FLOAT_PERSPECTIVE], _option) + sSepString;
2312
2313 if (asstr)
2314 sReturn += "plotcolors=\\\"" + stringSettings[STR_COLORS] + "\\\"" + sSepString;
2315 else
2316 sReturn += "plotcolors=\"" + stringSettings[STR_COLORS] + "\"" + sSepString;
2317
2318 if (asstr)
2319 sReturn += "pointstyles=\\\"" + stringSettings[STR_POINTSTYLES] + "\\\"" + sSepString;
2320 else
2321 sReturn += "pointstyles=\"" + stringSettings[STR_POINTSTYLES] + "\"" + sSepString;
2322
2324 sReturn += "pipe" + sSepString;
2325
2327 {
2328 if (intSettings[INT_HIGHRESLEVEL] == 1)
2329 sReturn += "medium";
2330 else
2331 sReturn += "high";
2332 sReturn += " resolution" + sSepString;
2333 }
2334
2335 sReturn += "rotate=" + toString(dRotateAngles[0], _option) + "," + toString(dRotateAngles[1], _option) + sSepString;
2336 sReturn += "samples=" + toString(intSettings[INT_HIGHRESLEVEL]) + sSepString;
2337
2338 sReturn += "textsize=" + toString(floatSettings[FLOAT_TEXTSIZE], _option) + sSepString;
2339 sReturn += "tickstemplate=[";
2340
2341 for (int i = 0; i < 4; i++)
2342 {
2343 if (i == 3)
2344 {
2345 if (asstr)
2346 sReturn += "c=\\\"" + sTickTemplate[i] + "\\\"";
2347 else
2348 sReturn += "c=\"" + sTickTemplate[i] + "\"";
2349 }
2350 else
2351 {
2352 sReturn += char('x'+i);
2353 if (asstr)
2354 sReturn += "=\\\"" + sTickTemplate[i] + "\\\", ";
2355 else
2356 sReturn += "=\"" + sTickTemplate[i] + "\", ";
2357 }
2358 }
2359
2360 sReturn += "]" + sSepString;
2361 sReturn += "tickslabels=[";
2362
2363 for (int i = 0; i < 4; i++)
2364 {
2365 if (i == 3)
2366 {
2367 if (asstr)
2368 sReturn += "c=\\\"" + sCustomTicks[i] + "\\\"";
2369 else
2370 sReturn += "c=\"" + sCustomTicks[i] + "\"";
2371 }
2372 else
2373 {
2374 sReturn += char('x'+i);
2375 if (asstr)
2376 sReturn += "=\\\"" + sCustomTicks[i] + "\\\", ";
2377 else
2378 sReturn += "=\"" + sCustomTicks[i] + "\", ";
2379 }
2380 }
2381
2382 sReturn += "]" + sSepString;
2383
2384 if (asstr)
2385 sReturn += "\"";
2386
2387 return sReturn;
2388}
2389
2390
2398void PlotData::setSamples(int _nSamples)
2399{
2400 intSettings[INT_SAMPLES] = _nSamples;
2401}
2402
2403
2411void PlotData::setFileName(std::string _sFileName)
2412{
2413 if (_sFileName.length())
2414 {
2415 std::string sExt = _sFileName.substr(_sFileName.rfind('.'));
2416
2417 if (sExt[sExt.length()-1] == '"')
2418 sExt = sExt.substr(0,sExt.length()-1);
2419
2420 if (_sFileName.find('\\') == std::string::npos && _sFileName.find('/') == std::string::npos)
2421 {
2422 if (sPath[0] == '"' && sPath[sPath.length()-1] == '"')
2423 stringSettings[STR_FILENAME] = sPath.substr(0,sPath.length()-1)+"/"+_sFileName+"\"";
2424 else
2425 stringSettings[STR_FILENAME] = sPath + "/" + _sFileName;
2426 }
2427 else
2428 stringSettings[STR_FILENAME] = _sFileName;
2429
2431 }
2432 else
2434}
2435
2436
2445void PlotData::replaceControlChars(std::string& sString)
2446{
2447 if (sString.find('\t') == std::string::npos && sString.find('\n') == std::string::npos)
2448 return;
2449
2450 for (size_t i = 0; i < sString.length(); i++)
2451 {
2452 if (sString[i] == '\t' && sString.substr(i+1,2) == "au")
2453 sString.replace(i, 1, "\\t");
2454
2455 if (sString[i] == '\n' && sString[i+1] == 'u')
2456 sString.replace(i, 1, "\\n");
2457 }
2458}
2459
2460
2468std::string PlotData::removeSurroundingQuotationMarks(const std::string& sString)
2469{
2470 if (sString.front() == '"' && sString.back() == '"')
2471 return sString.substr(1,sString.length()-2);
2472
2473 return sString;
2474}
2475
2476
2482{
2483 std::string x;
2484 std::string y;
2485 std::string z;
2486};
2487
2488
2497static std::map<CoordinateSystem, AxisLabels> getLabelDefinitions()
2498{
2499 std::map<CoordinateSystem, AxisLabels> mLabels;
2500
2501 mLabels[CARTESIAN] = {"\\i x", "\\i y", "\\i z"};
2502 mLabels[POLAR_PZ] = {"\\varphi [\\pi]", "\\i z", "\\rho"};
2503 mLabels[POLAR_RP] = {"\\rho", "\\varphi [\\pi]", "\\i z"};
2504 mLabels[POLAR_RZ] = {"\\rho", "\\i z", "\\varphi [\\pi]"};
2505 mLabels[SPHERICAL_PT] = {"\\varphi [\\pi]", "\\vartheta [\\pi]", "\\i r"};
2506 mLabels[SPHERICAL_RP] = {"\\i r", "\\varphi [\\pi]", "\\vartheta [\\pi]"};
2507 mLabels[SPHERICAL_RT] = {"\\i r", "\\vartheta [\\pi]", "\\varphi [\\pi]"};
2508
2509 return mLabels;
2510}
2511
2512
2521std::string PlotData::getAxisLabel(size_t axis) const
2522{
2523 if (!bDefaultAxisLabels[axis])
2524 return replaceToTeX(sAxisLabels[axis]);
2526 {
2527 if (axis == XCOORD)
2528 return "Re \\i z";
2529 else if (axis == YCOORD)
2530 return "Im \\i z";
2531 else if (axis == ZCOORD)
2532 return "|\\i z|";
2533 }
2534 else
2535 {
2536 static std::map<CoordinateSystem,AxisLabels> mLabels = getLabelDefinitions();
2537
2538 if (axis == XCOORD)
2539 return mLabels[(CoordinateSystem)intSettings[INT_COORDS]].x;
2540 else if (axis == YCOORD)
2541 return mLabels[(CoordinateSystem)intSettings[INT_COORDS]].y;
2542 else if (axis == ZCOORD)
2543 return mLabels[(CoordinateSystem)intSettings[INT_COORDS]].z;
2544 }
2545
2546 return "";
2547}
2548
2549
2550
2551
std::string toLowerCase(const std::string &)
Converts uppercase to lowercase letters.
This class implements the basic input/ output file system and provides functionalities to work with f...
Definition: filesystem.hpp:92
std::string sPath
Definition: filesystem.hpp:98
std::string ValidizeAndPrepareName(const std::string &_sFileName, const std::string &sExtension=".dat") const
This member function validizes the passed file name and creates the needed folders on-the-fly.
Definition: filesystem.cpp:424
std::string ValidFileName(std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const
This member function evaluates, whether the passed filename is a valid filename. One may supply a pre...
Definition: filesystem.cpp:280
std::string sTokens[7][2]
Definition: filesystem.hpp:100
This class represents a single interval in code providing reading access functionality.
Definition: interval.hpp:34
void reset(const std::string &sDef)
Reset the interval with a new definition.
Definition: interval.cpp:402
This class represents the central memory managing instance. It will handle all tables and clusters,...
bool containsTablesOrClusters(const std::string &sCmdLine)
This member function evaluates, whether the passed command line contains tables or clusters.
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
Definition: kernel.hpp:221
mu::Parser & getParser()
Definition: kernel.hpp:281
MemoryManager & getMemoryManager()
Definition: kernel.hpp:263
Settings & getSettings()
Definition: kernel.hpp:296
double floatSettings[FLOAT_SETTING_SIZE]
Definition: plotdata.hpp:169
int intSettings[INT_SETTING_SIZE]
Definition: plotdata.hpp:168
bool bLogscale[4]
Definition: plotdata.hpp:157
TimeAxis _timeAxes[4]
Definition: plotdata.hpp:175
@ STR_GRIDSTYLE
Definition: plotdata.hpp:141
@ STR_BACKGROUND
Definition: plotdata.hpp:129
@ STR_FILENAME
Definition: plotdata.hpp:138
@ STR_PLOTTITLE
Definition: plotdata.hpp:145
@ STR_SETTING_SIZE
Definition: plotdata.hpp:147
@ STR_COLORSCHEME
Definition: plotdata.hpp:132
@ STR_COLORSCHEMEMEDIUM
Definition: plotdata.hpp:134
@ STR_LINESTYLESGREY
Definition: plotdata.hpp:144
@ STR_LINESTYLES
Definition: plotdata.hpp:143
@ STR_LINESIZES
Definition: plotdata.hpp:142
@ STR_AXISBIND
Definition: plotdata.hpp:128
@ STR_COLORSCHEMELIGHT
Definition: plotdata.hpp:133
@ STR_FONTSTYLE
Definition: plotdata.hpp:139
@ STR_BACKGROUNDCOLORSCHEME
Definition: plotdata.hpp:130
@ STR_CONTCOLORS
Definition: plotdata.hpp:136
@ STR_CONTGREYS
Definition: plotdata.hpp:137
@ STR_POINTSTYLES
Definition: plotdata.hpp:146
@ STR_COLORS
Definition: plotdata.hpp:131
@ STR_COMPOSEDTITLE
Definition: plotdata.hpp:135
void setSamples(int _nSamples)
Change the number of samples.
Definition: plotdata.cpp:2398
void setFileName(std::string _sFileName)
Change the output file name.
Definition: plotdata.cpp:2411
bool bDefaultAxisLabels[3]
Definition: plotdata.hpp:156
std::string sCustomTicks[4]
Definition: plotdata.hpp:160
@ INT_LEGENDPOSITION
Definition: plotdata.hpp:105
@ INT_LEGENDSTYLE
Definition: plotdata.hpp:106
@ INT_COORDS
Definition: plotdata.hpp:102
@ INT_SETTING_SIZE
Definition: plotdata.hpp:112
@ INT_COMPLEXMODE
Definition: plotdata.hpp:100
@ INT_LIGHTING
Definition: plotdata.hpp:107
@ INT_AXIS
Definition: plotdata.hpp:99
@ INT_SAMPLES
Definition: plotdata.hpp:109
@ INT_SIZE_X
Definition: plotdata.hpp:110
@ INT_ANIMATESAMPLES
Definition: plotdata.hpp:98
@ INT_SIZE_Y
Definition: plotdata.hpp:111
@ INT_CONTLINES
Definition: plotdata.hpp:101
@ INT_HIGHRESLEVEL
Definition: plotdata.hpp:104
std::string stringSettings[STR_SETTING_SIZE]
Definition: plotdata.hpp:170
std::string getAxisLabel(size_t axis) const
Return the axis label associated to the selected axis.
Definition: plotdata.cpp:2521
std::string sTickTemplate[4]
Definition: plotdata.hpp:159
@ FLOAT_SETTING_SIZE
Definition: plotdata.hpp:123
@ FLOAT_TEXTSIZE
Definition: plotdata.hpp:122
@ FLOAT_ALPHAVAL
Definition: plotdata.hpp:117
@ FLOAT_ASPECT
Definition: plotdata.hpp:118
@ FLOAT_HBARS
Definition: plotdata.hpp:120
@ FLOAT_PERSPECTIVE
Definition: plotdata.hpp:121
@ FLOAT_BARS
Definition: plotdata.hpp:119
unsigned short nSlices[3]
Definition: plotdata.hpp:164
void replaceControlChars(std::string &sString)
Replaces tab and newlines correspondingly.
Definition: plotdata.cpp:2445
double dOrigin[3]
Definition: plotdata.hpp:163
int nRanges
Definition: plotdata.hpp:152
std::vector< Line > _lVLines
Definition: plotdata.hpp:173
bool logicalSettings[LOG_SETTING_SIZE]
Definition: plotdata.hpp:167
void reset()
Resets all settings to the initialisation stage.
Definition: plotdata.cpp:1897
std::string sAxisLabels[3]
Definition: plotdata.hpp:158
void setParams(const std::string &__sCmd, int nType=ALL)
Identifies parameters and values in the passed parameter string and updates the selected type of the ...
Definition: plotdata.cpp:233
Axis _AddAxes[2]
Definition: plotdata.hpp:174
bool getSettings(LogicalPlotSetting setting) const
Definition: plotdata.hpp:210
double dRotateAngles[2]
Definition: plotdata.hpp:161
std::string getParams(bool asstr=false) const
Return the internal plotting parameters as a human-readable string. Can be converted to an internal s...
Definition: plotdata.cpp:2084
@ SUPERGLOBAL
Definition: plotdata.hpp:57
IntervalSet ranges
Definition: plotdata.hpp:151
@ LOG_CRUST
Definition: plotdata.hpp:76
@ LOG_YERROR
Definition: plotdata.hpp:83
@ LOG_TABLE
Definition: plotdata.hpp:92
@ LOG_ALLHIGHRES
Definition: plotdata.hpp:62
@ LOG_PARAMETRIC
Definition: plotdata.hpp:86
@ LOG_REGION
Definition: plotdata.hpp:88
@ LOG_FIXEDLENGTH
Definition: plotdata.hpp:79
@ LOG_SILENTMODE
Definition: plotdata.hpp:90
@ LOG_CONTPROJ
Definition: plotdata.hpp:75
@ LOG_XERROR
Definition: plotdata.hpp:82
@ LOG_COLORMASK
Definition: plotdata.hpp:71
@ LOG_COLORBAR
Definition: plotdata.hpp:70
@ LOG_STEPPLOT
Definition: plotdata.hpp:91
@ LOG_ANIMATE
Definition: plotdata.hpp:65
@ LOG_ALPHAMASK
Definition: plotdata.hpp:64
@ LOG_PIPE
Definition: plotdata.hpp:87
@ LOG_AREA
Definition: plotdata.hpp:66
@ LOG_CLOUDPLOT
Definition: plotdata.hpp:69
@ LOG_BOXPLOT
Definition: plotdata.hpp:68
@ LOG_ORTHOPROJECT
Definition: plotdata.hpp:85
@ LOG_INTERPOLATE
Definition: plotdata.hpp:81
@ LOG_SCHEMATIC
Definition: plotdata.hpp:89
@ LOG_FLOW
Definition: plotdata.hpp:80
@ LOG_CONNECTPOINTS
Definition: plotdata.hpp:72
@ LOG_ALPHA
Definition: plotdata.hpp:63
@ LOG_CONTLABELS
Definition: plotdata.hpp:74
@ LOG_DRAWPOINTS
Definition: plotdata.hpp:78
@ LOG_OPENIMAGE
Definition: plotdata.hpp:84
@ LOG_SETTING_SIZE
Definition: plotdata.hpp:93
@ LOG_CONTFILLED
Definition: plotdata.hpp:73
@ LOG_CUTBOX
Definition: plotdata.hpp:77
void deleteData(bool bGraphFinished=false)
Delete the internal per-plot data (i.e. weak reset).
Definition: plotdata.cpp:2011
int nRequestedLayers
Definition: plotdata.hpp:153
PlotData()
PlotData constructor. Calls PlotData::reset() for initialisation.
Definition: plotdata.cpp:216
bool bMirror[4]
Definition: plotdata.hpp:155
int nTargetGUI[2]
Definition: plotdata.hpp:165
std::vector< Line > _lHlines
Definition: plotdata.hpp:172
bool bRanges[4]
Definition: plotdata.hpp:154
std::string removeSurroundingQuotationMarks(const std::string &sString)
Removes surrounding quotation marks.
Definition: plotdata.cpp:2468
double dAxisScale[4]
Definition: plotdata.hpp:162
This class manages the setting values of the internal (kernel) settings of this application.
Definition: settings.hpp:663
std::string getDefaultPlotFont() const
Returns the current plotting font name.
Definition: settings.hpp:1111
size_t getPrecision() const
Returns the precision for displaying floating numbers in the terminal. This value determines the numb...
Definition: settings.hpp:1000
void SetExpr(StringView a_sExpr)
Set the expression. Triggers first time calculation thus the creation of the bytecode and scanning of...
value_type Eval()
Single-value wrapper around the vectorized overload of this member function.
Mathematical expressions parser.
Definition: muParser.h:51
string getDataElements(string &sLine, Parser &_parser, MemoryManager &_data, const Settings &_option, int options)
Searches the passed string for calls to any table or cluster and replaces them with internal vectors ...
Definition: dataaccess.cpp:276
CONSTCD14 std::enable_if< detail::no_overflow< Period, typenameTo::period >::value, To >::type floor(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:1251
CONSTCD14 To ceil(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:1302
MUP_BASETYPE value_type
The numeric datatype used by the parser.
Definition: muParserDef.h:251
bool isnan(const value_type &v)
Definition: muParserDef.h:379
std::vector< double > real(const std::vector< value_type > &vVec)
bool isinf(const value_type &v)
Definition: muParserDef.h:374
static bool checkLineChars(const std::string &sLineSet)
Static helper function to evaluate the passed line type characters for their validness.
Definition: plotdata.cpp:97
mglGraph _fontData
Definition: kernel.cpp:40
static bool checkColorChars(const std::string &sColorSet)
Static helper function to evaluate the passed color characters for their validness.
Definition: plotdata.cpp:65
static std::map< CoordinateSystem, AxisLabels > getLabelDefinitions()
Static helper function to create a map containing the standard axis labels for each coordinate system...
Definition: plotdata.cpp:2497
#define STYLES_COUNT
Definition: plotdata.cpp:24
static std::map< std::string, std::string > getColorSchemes()
Static helper function to create a map containing all color schemes and their corresponding color cha...
Definition: plotdata.cpp:181
static std::map< std::string, std::pair< PlotData::LogicalPlotSetting, PlotData::ParamType > > getGenericSwitches()
Static helper function to create a map containing the simple logical plot settings.
Definition: plotdata.cpp:141
bool isNotEmptyExpression(const std::string &sExpr)
This function checks, whether the passed expression is non-empty (i.e. it contains more than white sp...
static bool checkPointChars(const std::string &sPointSet)
Static heloer function to evaluate the passeed point type characters for their validness.
Definition: plotdata.cpp:120
const char * SECAXIS_DEFAULT_COLOR
Definition: plotdata.cpp:27
static mu::value_type * evaluateNumerical(int &nResults, std::string sExpression)
Static helper function to evaluate numerical parameters.
Definition: plotdata.cpp:42
@ AXIS_NONE
Definition: plotdef.hpp:72
@ AXIS_STD
Definition: plotdef.hpp:73
@ AXIS_NICE
Definition: plotdef.hpp:74
@ AXIS_EQUAL
Definition: plotdef.hpp:75
@ CPLX_PLANE
Definition: plotdef.hpp:35
@ CPLX_REIM
Definition: plotdef.hpp:34
@ CPLX_NONE
Definition: plotdef.hpp:33
@ TRANGE
Definition: plotdef.hpp:54
@ XRANGE
Definition: plotdef.hpp:50
@ CRANGE
Definition: plotdef.hpp:53
@ YRANGE
Definition: plotdef.hpp:51
@ ZRANGE
Definition: plotdef.hpp:52
CoordinateSystem
Definition: plotdef.hpp:59
@ POLAR_RP
Definition: plotdef.hpp:62
@ POLAR_RZ
Definition: plotdef.hpp:63
@ SPHERICAL_RP
Definition: plotdef.hpp:65
@ POLAR_PZ
Definition: plotdef.hpp:61
@ SPHERICAL_RT
Definition: plotdef.hpp:66
@ SPHERICAL_PT
Definition: plotdef.hpp:64
@ CARTESIAN
Definition: plotdef.hpp:60
@ ZCOORD
Definition: plotdef.hpp:43
@ XCOORD
Definition: plotdef.hpp:41
@ YCOORD
Definition: plotdef.hpp:42
void StripSpaces(std::string &)
Removes leading and trailing white spaces and tabulator characters.
int findParameter(const std::string &sCmd, const std::string &sParam, const char cFollowing)
This function searches the passed parameter in the passed command string. If something is found,...
Definition: tools.cpp:113
std::string getNextArgument(std::string &sArgList, bool bCut)
Definition: tools.cpp:2294
Interval ivl
Definition: interval.hpp:123
std::string sStyle
Definition: interval.hpp:122
std::string sLabel
Definition: interval.hpp:121
Structure for simplification of the standard axis labels.
Definition: plotdata.cpp:2482
std::string y
Definition: plotdata.cpp:2484
std::string z
Definition: plotdata.cpp:2485
std::string x
Definition: plotdata.cpp:2483
void setNames(const std::vector< std::string > &vNames)
Set the interval names.
Definition: interval.cpp:677
std::vector< Interval > intervals
Definition: interval.hpp:85
Structure for the horizontal and vertical lines in plots.
Definition: interval.hpp:107
void activate(const std::string &sFormat="")
Definition: interval.hpp:138
void deactivate()
Definition: interval.hpp:171
long long int intCast(const std::complex< double > &)
Casts the real part of the complex number to an integer and avoids rounding errors.
Definition: tools.cpp:1824
std::string toString(int)
Converts an integer to a string without the Settings bloat.
string getArgAtPos(const string &sCmd, unsigned int nPos, int extraction)
Extracts a options value at the selected position and applies automatic parsing, if necessary.
Definition: tools.cpp:1598
std::string replaceToTeX(const std::string &sString, bool replaceForTeXFile)
Replace the special tokens with their TeX counterparts, so that they can be handled by a LaTeX interp...
Definition: tools.cpp:753
bool isInQuotes(StringView sExpr, unsigned int nPos, bool bIgnoreVarParser)
Checks, whether the position in the passed expression is part of a string literal.
Definition: tools.cpp:1672
EndlessVector< StringView > getAllArguments(StringView sArgList)
Splits up the complete argument list and returns them as an EndlessVector.
Definition: tools.cpp:2346
@ ARGEXTRACT_STRIPPED
Definition: tools.hpp:56
@ ARGEXTRACT_PARSED
Definition: tools.hpp:57
@ ARGEXTRACT_ASSTRING
Definition: tools.hpp:59