34 return std::string(
"<unknown>");
48 if (comment.find(
'.') != std::string::npos || comment.find(
'e') != std::string::npos) {
71 s <<
name <<
" " <<
v <<
" in [" <<
min <<
"," <<
max <<
"] subset " << (
isInt ?
"Integers" :
"Reals");
82 if (
const auto *o =
dynamic_cast<const NumberEditable *
>(&other)) {
83 return min == o->min &&
max == o->max &&
v == o->v &&
isInt == o->isInt &&
name == o->name;
103 if (fmin < 0.0 || fmax > 1.0) {
114 s <<
name <<
" " <<
v <<
" in [" <<
min <<
"," <<
max <<
"]";
125 if (
const auto *o =
dynamic_cast<const VectorEditable *
>(&other)) {
126 return min == o->min &&
max == o->max &&
v == o->v &&
name == o->name;
132 :
Editable(
"unknown", startPos, endPos)
139 std::string namebuf {};
140 std::string typebuf {};
154 stream <<
"\"" <<
v <<
"\"";
166 if (
const auto *o =
dynamic_cast<const StringEditable *
>(&other)) {
167 return v == o->v &&
type == o->type &&
name == o->name;
179 std::string labelbuf {};
190 s <<
name <<
" swatch";
196 for (
const auto &color :
colors) {
206 && o->colors.size() == this->
colors.size()
207 && std::equal(o->colors.begin(), o->colors.end(), this->colors.begin());
230 for (
const auto &color :
colors) {
231 dbgSeExpr << color[0] <<
", " << color[1] <<
", " << color[2];
void printVal(std::stringstream &stream, double v)
bool controlsMatch(const Editable &other) const override
void change(int index, const KSeExpr::Vec3d &value)
void add(const KSeExpr::Vec3d &value)
std::string str() const override
ColorSwatchEditable(const std::string &name, int startPos, int endPos)
void appendString(std::stringstream &stream) const override
bool parseComment(const std::string &comment) override
parses a comment. if false is returned then delete the control from the editable
std::vector< KSeExpr::Vec3d > colors
virtual std::string str() const
void updatePositions(const Editable &other)
Editable(const std::string &name, int startPos, int endPos)
bool parseComment(const std::string &comment) override
parses a comment. if false is returned then delete the control from the editable
bool controlsMatch(const Editable &other) const override
NumberEditable(const std::string &name, int startPos, int endPos, double val)
void appendString(std::stringstream &stream) const override
std::string str() const override
bool parseComment(const std::string &comment) override
parses a comment. if false is returned then delete the control from the editable
std::string str() const override
bool controlsMatch(const Editable &other) const override
StringEditable(int startPos, int endPos, const std::string &val)
void appendString(std::stringstream &stream) const override
void appendString(std::stringstream &stream) const override
std::string str() const override
bool controlsMatch(const Editable &other) const override
bool parseComment(const std::string &comment) override
parses a comment. if false is returned then delete the control from the editable
VectorEditable(const std::string &name, int startPos, int endPos, const KSeExpr::Vec3d &val)
bool parseRangeComment(const std::string &comment, double &from, double &to)
bool parseLabelComment(const std::string &comment, std::string &label)
bool parseTypeNameComment(const std::string &comment, std::string &type, std::string &name)