39 std::stringstream ss(str);
43 auto ramp = std::make_shared<Ramp>();
45 int countMyCoord = -1;
49 std::string currentVarName;
53 if (isalpha(substr[0]))
55 currentVarName = substr;
58 if (currentVarName ==
"UserPoints")
61 if (countMyCoord > 0 && countMyCoord % 2 != 0)
63 tempCoord = std::stod(substr);
65 else if (countMyCoord > 0 && countMyCoord % 2 == 0)
67 ramp->getUserPoints().push_back(
Ramp::Coord2D(tempCoord, std::stod(substr)));
70 else if (currentVarName ==
"UserHandles")
73 if (countHandle > 0 && countHandle % 2 != 0)
75 tempCoord = std::stod(substr);
77 else if (countHandle > 0 && countHandle % 2 == 0)
79 ramp->getUserHandles().push_back(
Ramp::Coord2D(tempCoord, std::stod(substr)));
82 else if (currentVarName ==
"Resample")
83 ramp->setVarByStr(substr, ramp->getResample());
84 else if (currentVarName ==
"Spacing")
85 ramp->setVarByStr(substr, ramp->getSpacing());
86 else if (currentVarName ==
"Close")
87 ramp->setVarByStr(substr, ramp->getClose());
88 else if (currentVarName ==
"InterpMode")
89 ramp->setVarByStr(substr, ramp->getInterpMode());
92 ramp->updateBezierCurve();
93 ramp->UpdateFieldFinalCoord();