7 #include "GmshConfig.h"
35 if(numIso == 1)
return (min + max) / 2.;
43 else if(iso == numIso - 1)
46 return min + iso * (max - min) / (numIso - 1.);
50 if(min <= 0.)
return 0;
52 log10(min) + iso * (log10(max) - log10(min)) / (numIso - 1.));
55 if(min <= 0.)
return 0;
56 double iso2 = iso / 2.;
57 double numIso2 = numIso / 2.;
59 log10(min) + iso2 * (log10(max) - log10(min)) / (numIso2 - 1.));
67 if(min == max)
return numIso / 2;
70 return (
int)((val - min) * (numIso - 1) / (max - min));
73 if(min <= 0.)
return 0;
74 return (
int)((log10(val) - log10(min)) * (numIso - 1) /
75 (log10(max) - log10(min)));
79 if(min <= 0.)
return 0;
80 return (
int)((log10(val) - log10(min)) * (numIso - 1) /
81 (log10(max) - log10(min)));
87 bool forceLinear,
int numColors)
102 int index =
getScaleIndex(val, numColors + 1, min, max, forceLinear);
103 if(index > numColors - 1) index = numColors - 1;
110 int index = (nb == 1) ?
122 const char *names[] = {
"x",
"y",
"z",
"v0",
"v1",
"v2",
"v3",
123 "v4",
"v5",
"v6",
"v7",
"v8",
"s",
"t"};
124 std::size_t numVariables =
sizeof(names) /
sizeof(names[0]);
125 std::vector<std::string> expressions(3), variables(numVariables);
129 for(std::size_t i = 0; i < numVariables; i++) variables[i] = names[i];
133 if(expressions.empty()) {
153 default:
return true;