SeExpr

ExprControl.cpp
Go to the documentation of this file.
1 /*
2 * Copyright Disney Enterprises, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License
6 * and the following modification to it: Section 6 Trademarks.
7 * deleted and replaced with:
8 *
9 * 6. Trademarks. This License does not grant permission to use the
10 * trade names, trademarks, service marks, or product names of the
11 * Licensor and its affiliates, except as required for reproducing
12 * the content of the NOTICE file.
13 *
14 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * @file ExprControl.cpp
18 * @brief UI control widgets for expressions.
19 * @author aselle
20 */
21 #include <QRegExp>
22 #include <QLineEdit>
23 #include <QPushButton>
24 #include <QToolButton>
25 #include <QSplitter>
26 #include <QLabel>
27 #include <QMouseEvent>
28 #include <QKeyEvent>
29 #include <QHBoxLayout>
30 #include <QVBoxLayout>
31 #include <QPaintEvent>
32 #include <QPainter>
33 #include <QScrollArea>
34 #include <QSpacerItem>
35 #include <QSizePolicy>
36 #include <QTextCharFormat>
37 #include <QCompleter>
38 #include <QAbstractItemView>
39 #include <QStandardItemModel>
40 #include <QStringListModel>
41 #include <QFileDialog>
42 #include <QDialogButtonBox>
43 #include <QScrollBar>
44 #include <QToolTip>
45 #include <QListWidget>
46 #include <QTreeView>
47
48 #include "ExprControl.h"
49 #include "ExprColorCurve.h"
50 #include "ExprColorSwatch.h"
51 #include "ExprFileDialog.h"
52 #include "Editable.h"
53
54 /* XPM */
55 static const char* refreshXPM[] = {
56 "20 20 4 1", "# c #303030", "a c #585858", "b c #c3c3c3",
57 ". c #dcdcdc", "....................", "....................", "....................",
58 ".......#aaaa#.......", ".....#########......", "....###bbbbb###.....", "....##b.....b##.....",
59 "...bb#b.....b##.....", "...bbbb....aaaaaa...", "...........aaaaaa...", "....##......####....",
60 "...####......##.....", "..######............", "..aaa#aa............", "....##......bbb.....",
61 "....##b...bbbab.....", "....a#abbbb##ab.....", ".....#a####aa#b.....", ".....aaaaaaa#.b.....",
62 "...................."};
63
64 /* XPM */
65 static const char* graphXPM[] = {
66 "20 20 5 1", "c c #000040", "a c #303030", "# c #58a8ff",
67 ". c #dcdcdc", "b c #ff0000", "..........#a.a......", "..........#a.a.....b",
68 "..........#.a.....bb", "..........#aa....bb.", "..........#.....bb..", "..........#....bb...",
69 "..........#....bb...", "....bbb...#...bb....", "...bbbbb..#..bbb....", "...b...bbb#.bbb.....",
70 "..bb....bb#bbb......", "##bb####bbbbb#######", ".bb......bbb....c.c.", ".bb.......#......c..",
71 ".b........#.....c.c.", "bb........#.........", "b.........#.........", "..........#.........",
72 "..........#.........", "..........#........."};
73
74 /* XPM */
75 static const char* directoryXPM[] = {
76 "20 20 3 1", ". c None", "# c #000000", "a c #d8c59e",
77 "....................", "....................", "....................", "....................",
78 "...........#######..", "...........#aaaaa#..", "..##########aaaaa#..", "..#aaaaaaaaaaaaaa#..",
79 "..#aaaaaaaaaaaaaa#..", "..#aaaaaaaaaaaaaa#..", "..#aaaaaaaaaaaaaa#..", "..#aaaaaaaaaaaaaa#..",
80 "..#aaaaa##a##a##a#..", "..#aaaaa##a##a##a#..", "..#aaaaaaaaaaaaaa#..", "..################..",
81 "....................", "....................", "....................", "...................."};
82
83 /* XPM */
84 static const char* fileXPM[] = {
85 "20 20 5 1", ". c None", "# c #000000", "c c #303030",
86 "b c #a79b80", "a c #ddcdaa", "....................", "....................",
87 "....#########.......", "....#aaaaaaa##......", "....#aaaaaaa#b#.....", "....#aaaaaaa#bb#....",
88 "....#aaaaaaa####....", "....#aaaaaaaaaa#....", "....#aaaaaaaaaa#....", "....#aaaaaaaaaa#....",
89 "....#aaaaaaaaaa#....", "....#aaaaaaaaaa#....", "....#aaaaaaaaaa#....", "....#aaaaaaaaaa#....",
90 "....#aaaaaaaaaa#....", "....#accaccacca#....", "....#accaccacca#....", "....#aaaaaaaaaa#....",
91 "....############....", "...................."};
92
93 void ExprSlider::mousePressEvent(QMouseEvent* e) { mouseMoveEvent(e); }
94
95 void ExprSlider::mouseMoveEvent(QMouseEvent* e) {
96 float r = maximum() - minimum();
97 float v = ((float)(e->x() - 2) * r / (width() - 5)) + minimum() + .5f;
98 int iv = std::min(std::max((int)v, minimum()), maximum());
99 setValue(iv);
100 }
101
102 void ExprSlider::paintEvent(QPaintEvent* e) {
103 Q_UNUSED(e);
104 QPainter p(this);
105
106 float v = value();
107 float r = maximum() - minimum();
108 int linepos = (int)((v - minimum()) / r * (width() - 5) + 2);
109
110 QColor qcol = palette().color(QPalette::Dark);
111 QColor bcol = palette().color(QPalette::Midlight);
112 QColor dcol = bcol.lighter(140);
113 QColor bgcol = palette().color(QPalette::Base);
114
115 if (underMouse()) {
116 bcol = bcol.lighter(110);
117 bgcol = bgcol.lighter(110);
118 int mx = mapFromGlobal(QCursor::pos()).x();
119 if (abs(linepos - mx) < 4) dcol = dcol.lighter(200);
120 }
121
122 p.fillRect(1, 1, width() - 1, height() - 2, bgcol);
123 p.fillRect(1, 1, linepos - 1, height() - 2, bcol);
124
125 QPen pen = p.pen();
126
127 pen.setColor(dcol);
128 p.setPen(pen);
129 pen.setWidth(3);
130 p.setPen(pen);
131 p.drawLine(linepos, 2, linepos, height() - 2);
132 pen.setWidth(1);
133 pen.setColor(qcol);
134 p.setPen(pen);
135 p.drawLine(linepos - 2, 1, linepos - 2, height() - 1);
136 p.drawLine(linepos + 2, 1, linepos + 2, height() - 1);
137
138 pen.setWidth(1);
139 pen.setColor(qcol);
140 p.setPen(pen);
141 p.drawRect(0, 0, width() - 1, height() - 1);
142 }
143
144 ExprChannelSlider::ExprChannelSlider(int id, QWidget* parent) : QWidget(parent), _id(id), _value(0) {}
145
146 void ExprChannelSlider::paintEvent(QPaintEvent* e) {
147 Q_UNUSED(e);
148 if (_value < 0 || _value > 1) return;
149 int x = int(_value * (width() - 3) + 0.5);
150 QPainter p(this);
151 p.fillRect(contentsRect(), _col);
152 p.fillRect(x, 0, 3, height(), QColor(64, 64, 64));
153 }
154
155 void ExprChannelSlider::mousePressEvent(QMouseEvent* e) { mouseMoveEvent(e); }
156
157 void ExprChannelSlider::mouseMoveEvent(QMouseEvent* e) { setValue(clamp(float(e->x() - 1) / (width() - 3), 0, 1)); }
158
159 void ExprChannelSlider::setValue(float value) {
160 if (value == _value) return;
161 _value = value;
162 emit valueChanged(_id, value);
163 update();
164 }
165
166 ExprControl::ExprControl(int id, Editable* editable, bool showColorLink)
167 : _id(id), _updating(false), _editable(editable) {
168 hbox = new QHBoxLayout(this);
169 hbox->setSpacing(2);
170 hbox->setMargin(0);
171
172 _colorLinkCB = new QCheckBox(this);
173 _colorLinkCB->setFixedWidth(14);
174 _colorLinkCB->setFocusPolicy(Qt::NoFocus);
175 connect(_colorLinkCB, SIGNAL(stateChanged(int)), this, SLOT(linkStateChange(int)));
176 hbox->addWidget(_colorLinkCB);
177
178 _label = new QLabel(QString("<b>") + editable->name.c_str() + "</b>");
179 _label->setFixedWidth(72);
180 _label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
181 _label->setIndent(2);
182 _label->setAutoFillBackground(true);
183 hbox->addWidget(_label);
184
185 if (!showColorLink) {
186 _colorLinkCB->setHidden(true);
187 _label->setFixedWidth(84);
188 } else {
189 _colorLinkCB->setHidden(false);
190 _label->setFixedWidth(84 - _colorLinkCB->width() + 2);
191 }
192 }
193
194 void ExprControl::linkStateChange(int state) {
195 if (_updating) return;
196
197 if (state == Qt::Checked) {
198 emit linkColorLink(_id);
199 emit linkColorEdited(_id, getColor());
200 } else {
201 emit linkColorLink(-1);
202 }
203 }
204
205 void ExprControl::linkDisconnect(int newId) {
206 if (newId != _id) {
207 _updating = 1;
208 _colorLinkCB->setChecked(false);
209 _updating = 0;
210 }
211 }
212
213 NumberControl::NumberControl(int id, NumberEditable* editable)
214 : ExprControl(id, editable, false), _numberEditable(editable) {
215
216 // slider
217 float smin = editable->min, smax = editable->max;
218 if (!_numberEditable->isInt) {
219 smin *= 1e5;
220 smax *= 1e5;
221 }
222 float srange = smax - smin;
223 _slider = new ExprSlider(Qt::Horizontal, this);
224 _slider->setRange(int(smin), int(smax));
225 _slider->setTickInterval(std::max(1, int(srange / 10)));
226 _slider->setSingleStep(std::max(1, int(srange / 50)));
227 _slider->setPageStep(std::max(1, int(srange / 10)));
228 _slider->setMinimumWidth(0);
229 _slider->setFixedHeight(16);
230 _slider->setFocusPolicy(Qt::ClickFocus);
231 hbox->addWidget(_slider, 3);
232 // edit box
233 _edit = new ExprLineEdit(0, this);
234 _edit->setMinimumWidth(0);
235 _edit->setFixedHeight(16);
236 hbox->addWidget(_edit);
237 connect(_edit, SIGNAL(textChanged(int, const QString&)), SLOT(editChanged(int, const QString&)));
238 connect(_slider, SIGNAL(valueChanged(int)), SLOT(sliderChanged(int)));
239 // show current values
240 updateControl();
241 }
242
243 void NumberControl::sliderChanged(int value) {
244 if (_updating) return;
245 setValue(_numberEditable->isInt ? value : value * 1e-5);
246 }
247
248 void NumberControl::editChanged(int id, const QString& text) {
249 Q_UNUSED(id);
250 if (_updating) return;
251 bool ok = 0;
252 float val = text.toFloat(&ok);
253 if (!ok) return;
254 setValue(val);
255 }
256
257 void NumberControl::updateControl() {
258 _updating = 1;
259 int sliderval = int(_numberEditable->isInt ? _numberEditable->v : _numberEditable->v * 1e5);
260 if (sliderval != _slider->value()) _slider->setValue(sliderval);
261 _edit->setText(QString("%1").arg(_numberEditable->v, 0, 'f', _numberEditable->isInt ? 0 : 3));
262 _updating = 0;
263 }
264
265 void NumberControl::setValue(float value) {
266 // std::cerr<<"In setValue "<<_id<<value<<std::endl;
267 if (fabs(_numberEditable->v - value) < 1e-5) return;
268 _numberEditable->v = value;
269 updateControl();
270 emit controlChanged(_id);
271 }
272
273 VectorControl::VectorControl(int id, VectorEditable* editable)
274 : ExprControl(id, editable, true), _numberEditable(editable) {
275
276 if (_numberEditable->isColor) {
277 _swatch = new ExprCSwatchFrame(editable->v);
278 _swatch->setFixedWidth(38);
279 _swatch->setFixedHeight(20);
280 connect(_swatch, SIGNAL(swatchChanged(QColor)), this, SLOT(swatchChanged(QColor)));
281 hbox->addWidget(_swatch);
282 }
283 for (int i = 0; i < 3; i++) {
284 QVBoxLayout* vbl = new QVBoxLayout();
285 hbox->addLayout(vbl);
286 vbl->setMargin(0);
287 vbl->setSpacing(0);
288
289 ExprLineEdit* edit = new ExprLineEdit(i, this);
290 vbl->addWidget(edit);
291 _edits[i] = edit;
292 edit->setMinimumWidth(0);
293 edit->setFixedHeight(16);
294
295 ExprChannelSlider* slider = new ExprChannelSlider(i, this);
296 vbl->addWidget(slider);
297 _sliders[i] = slider;
298 slider->setFixedHeight(6);
299 // set color
300 static const QColor rgb[3] = {QColor(128, 64, 64), QColor(64, 128, 64), QColor(64, 64, 128)};
301 if (_numberEditable->isColor) slider->setDisplayColor(rgb[i]);
302
303 connect(edit, SIGNAL(textChanged(int, const QString&)), SLOT(editChanged(int, const QString&)));
304 connect(slider, SIGNAL(valueChanged(int, float)), SLOT(sliderChanged(int, float)));
305 }
306 // update controls
307 updateControl();
308 }
309
310 void VectorControl::swatchChanged(QColor gah) {
311 Q_UNUSED(gah);
312 SeExpr2::Vec3d color = _swatch->getValue();
313 setValue(0, color[0]);
314 setValue(1, color[1]);
315 setValue(2, color[2]);
316 }
317
318 QColor VectorControl::getColor() {
319 return QColor::fromRgbF(
320 clamp(_numberEditable->v[0], 0, 1), clamp(_numberEditable->v[1], 0, 1), clamp(_numberEditable->v[2], 0, 1));
321 }
322
323 void VectorControl::setColor(QColor color) {
324 setValue(0, color.redF());
325 setValue(1, color.greenF());
326 setValue(2, color.blueF());
327 }
328
329 void VectorControl::sliderChanged(int id, float value) {
330 if (_updating) return;
331 setValue(id, _numberEditable->min + value * (_numberEditable->max - _numberEditable->min));
332 if (_numberEditable->isColor) emit linkColorEdited(_id, getColor());
333 }
334
335 void VectorControl::editChanged(int id, const QString& text) {
336 if (_updating) return;
337 bool ok = 0;
338 float val = text.toFloat(&ok);
339 if (!ok) return;
340 setValue(id, val);
341 }
342
343 void VectorControl::updateControl() {
344 // //std::cerr<<"In update control "<<_id<<std::endl;
345 _updating = 1;
346 for (unsigned int i = 0; i < 3; i++) _edits[i]->setText(QString("%1").arg(_numberEditable->v[i], 0, 'f', 3));
347 double min = _numberEditable->min, max = _numberEditable->max;
348 for (unsigned int i = 0; i < 3; i++) {
349 _sliders[i]->setValue((_numberEditable->v[i] - min) / (max - min));
350 }
351 if (_numberEditable->isColor) {
352 // std::cerr<<"trying to set color"<<std::endl;
353 SeExpr2::Vec3d val = _numberEditable->v;
354 float r = clamp(val[0], 0, 1);
355 float g = clamp(val[1], 0, 1);
356 float b = clamp(val[2], 0, 1);
357 float lum = r * .2 + g * .7 + b * .1;
358 // std::cerr<<" rgb "<<r<<" "<<g<<" "<<b<<std::endl;
359 QPalette pal = palette();
360 pal.setColor(QPalette::Window, QColor(int(r * 255), int(g * 255), int(b * 255)));
361 pal.setColor(QPalette::WindowText, (lum < 0.5) ? QColor(255, 255, 255) : QColor(0, 0, 0));
362 _label->setPalette(pal);
363 }
364 _updating = 0;
365 }
366
367 void VectorControl::setValue(int n, float value) {
368 if (n < 0 || n >= 3) return;
369 if (fabs(_numberEditable->v[n] - value) < 1e-5) return;
370 _numberEditable->v[n] = value;
371 if (_swatch) _swatch->setValue(_numberEditable->v);
372 updateControl();
373 emit controlChanged(_id);
374 }
375
376 StringControl::StringControl(int id, StringEditable* editable)
377 : ExprControl(id, editable, false), _stringEditable(editable) {
378 // make line edit
379 _edit = new QLineEdit();
380 _edit->setFixedHeight(20);
381 connect(_edit, SIGNAL(textChanged(const QString&)), SLOT(textChanged(const QString&)));
382 // make a button if we are a file or directory
383 if (_stringEditable->type == "file" || _stringEditable->type == "directory") {
384 QPushButton* button = new QPushButton();
385 button->setFixedSize(20, 20);
386
387 hbox->addWidget(_edit, 3);
388 hbox->addWidget(button, 1);
389 if (_stringEditable->type == "directory") {
390 connect(button, SIGNAL(clicked()), SLOT(directoryBrowse()));
391 button->setIcon(QIcon(QPixmap(directoryXPM)));
392 } else if (_stringEditable->type == "file") {
393 connect(button, SIGNAL(clicked()), SLOT(fileBrowse()));
394 button->setIcon(QIcon(QPixmap(fileXPM)));
395 }
396
397 } else {
398 hbox->addWidget(_edit, 3);
399 }
400 // update controls
401 updateControl();
402 }
403
404 void StringControl::fileBrowse() {
405 ExprFileDialog dialog(this);
406 dialog.setPreview();
407 QString newFilename =
408 dialog.getOpenFileName("Please choose a file", _edit->text(), tr("Images (*.tif *.tx *.jpg *.ptx *.png)"));
409 if (newFilename != "") _edit->setText(newFilename);
410 }
411
412 void StringControl::directoryBrowse() {
413 ExprFileDialog dialog(this);
414 dialog.setPreview();
415 QString newFilename = dialog.getExistingDirectory("Please choose a file", _edit->text());
416 if (newFilename != "") _edit->setText(newFilename);
417 }
418
419 void StringControl::updateControl() { _edit->setText(_stringEditable->v.c_str()); }
420
421 void StringControl::textChanged(const QString& newText) {
422 if (_updating) return;
423 _stringEditable->v = newText.toStdString();
424 emit controlChanged(_id);
425 }
426
427 CurveControl::CurveControl(int id, CurveEditable* editable)
428 : ExprControl(id, editable, false), _curveEditable(editable) {
429 _curve = new ExprCurve(this, "Pos:", "Val:", "Interp:");
430 _curve->setFixedHeight(80);
431
432 const int numVal = _curveEditable->cvs.size();
433 for (int i = 0; i < numVal; i++) {
434 const SeExpr2::Curve<double>::CV& cv = _curveEditable->cvs[i];
435 _curve->addPoint(cv._pos, cv._val, cv._interp);
436 }
437 hbox->addWidget(_curve, 3);
438 connect(_curve->_scene, SIGNAL(curveChanged()), SLOT(curveChanged()));
439 // unneded? updateControl();
440 }
441
442 void CurveControl::curveChanged() {
443 if (_curve && _curveEditable) {
444 _curveEditable->cvs = _curve->_scene->_cvs;
445 emit controlChanged(_id);
446 }
447 }
448
449 CCurveControl::CCurveControl(int id, ColorCurveEditable* editable)
450 : ExprControl(id, editable, true), _curveEditable(editable) {
451 _curve = new ExprColorCurve(this, "Pos:", "Val:", "Interp:");
452 _curve->setFixedHeight(80);
453
454 const int numVal = _curveEditable->cvs.size();
455 for (int i = 0; i < numVal; i++) {
456 const SeExpr2::Curve<SeExpr2::Vec3d>::CV& cv = _curveEditable->cvs[i];
457 _curve->addPoint(cv._pos, cv._val, cv._interp);
458 }
459 hbox->addWidget(_curve, 3);
460 connect(_curve->_scene, SIGNAL(curveChanged()), SLOT(curveChanged()));
461 // unneeded? updateControl();
462 }
463
464 void CCurveControl::curveChanged() {
465 if (_curve && _curveEditable) {
466 _curveEditable->cvs = _curve->_scene->_cvs;
467 emit controlChanged(_id);
468 }
469 }
470
471 QColor CCurveControl::getColor() { return _curve->getSwatchColor(); }
472
473 void CCurveControl::setColor(QColor color) { _curve->setSwatchColor(color); }
474
475 struct ExprGraphPreview : public QWidget {
476 std::vector<float> x, y;
477 std::vector<float> cpx, cpy;
478 float xmin, xmax, ymin, ymax, dx, dy;
479 ;
480 float win_xmin, win_xmax, win_ymin, win_ymax, win_dx, win_dy;
481 ;
482 ExprGraphPreview(QWidget* parent = 0) : QWidget(parent) {
483 win_xmin = -1.;
484 win_xmax = 2.;
485 win_ymin = -1;
486 win_ymax = 2.;
487 }
488
489 QPointF toScreen(float x, float y) { return QPointF((x - win_xmin) * win_dx, height() - (y - win_ymin) * win_dy); }
490
491 void paintEvent(QPaintEvent* event) {
492 QWidget::paintEvent(event);
493 QPainter painter(this);
494 painter.setRenderHint(QPainter::Antialiasing, true);
495 painter.setPen(QColor(255, 255, 255));
496 win_xmin = xmin;
497 win_xmax = xmax;
498 win_ymin = ymin;
499 win_ymax = ymax;
500 float percentXpad = .1 * (win_xmax - win_xmin);
501 float percentYpad = .1 * (win_ymax - win_ymin);
502 win_xmin -= percentXpad;
503 win_xmax += percentXpad;
504 win_ymin -= percentYpad;
505 win_ymax += percentYpad;
506
507 // make space for text
508 int x_pad_in_pixels = 25, y_pad_in_pixels = 15;
509 float xpad = x_pad_in_pixels * (win_xmax - win_xmin) / (width() - x_pad_in_pixels);
510 float ypad = y_pad_in_pixels * (win_ymax - win_ymin) / (height() - y_pad_in_pixels);
511 win_ymin -= ypad;
512 win_xmax += xpad;
513
514 win_dx = width() / (win_xmax - win_xmin);
515 win_dy = height() / (win_ymax - win_ymin);
516
517 // int h=height();
518 QPainterPath path;
519 QRectF fullarea(toScreen(win_xmin, win_ymax), toScreen(win_xmax, win_ymin));
520 QBrush darkbrush(QColor(100, 100, 100), Qt::SolidPattern);
521 QRectF area(toScreen(xmin, ymax), toScreen(xmax, ymin));
522 QBrush brush(QColor(150, 150, 150), Qt::SolidPattern);
523 // painter.fillRect(fullarea,darkbrush);
524 // painter.setBrush(darkbrush);
525 // painter.drawRoundedRect(fullarea,3,3);
526 // painter.setBrush(QBrush());
527 painter.fillRect(area, brush);
528 if (x.size() > 0) {
529 path.moveTo(toScreen(x[0], y[0]));
530 for (int i = 1; i < (int)x.size(); i++) path.lineTo(toScreen(x[i], y[i]));
531 }
532 QRectF right(toScreen(xmax, ymax), toScreen(win_xmax, ymin));
533 QRectF bottom(toScreen(xmin, ymin), toScreen(xmax, win_ymin));
534
535 painter.setPen(QColor(75, 50, 50));
536 painter.drawPath(path);
537
538 painter.setPen(QPen());
539 painter.drawText(right, Qt::AlignTop | Qt::AlignLeft, QString("%1").arg(ymax, 0, 'f', 1));
540 painter.drawText(right, Qt::AlignBottom | Qt::AlignLeft, QString("%1").arg(ymin, 0, 'f', 1));
541 painter.drawText(bottom, Qt::AlignTop | Qt::AlignLeft, QString("%1").arg(xmin, 0, 'f', 1));
542 painter.drawText(bottom, Qt::AlignTop | Qt::AlignRight, QString("%1").arg(xmax, 0, 'f', 1));
543
544 painter.setBrush(QBrush(QColor(0, 0, 0), Qt::SolidPattern));
545 for (size_t i = 0; i < cpx.size(); i++) {
546 painter.drawEllipse(toScreen(cpx[i], cpy[i]), 2, 2);
547 }
548 }
549
550 #ifdef SEEXPR_USE_ANIMLIB
551 void sample(const animlib::AnimCurve& curve) {
552 int numKeys = curve.getNumKeys();
553 x.clear();
554 y.clear();
555 cpx.clear();
556 cpy.clear();
557 if (numKeys > 0) {
558 const animlib::AnimKeyframe* key = &*curve.getFirstKey();
559 xmin = key[0].getTime();
560 xmax = key[numKeys - 1].getTime();
561 ymin = FLT_MAX;
562 ymax = -FLT_MAX;
563
564 for (int i = 0; i < numKeys; i++) {
565 cpx.push_back(key[i].getTime());
566 cpy.push_back(key[i].getValue());
567 }
568
569 int nsamples = 100;
570 float dx = (xmax - xmin) / nsamples;
571 float xeval = xmin;
572 for (int i = 0; i < nsamples; i++) {
573 x.push_back(xeval);
574 float yeval = curve.getValue(xeval);
575 ymin = std::min(ymin, yeval);
576 ymax = std::max(ymax, yeval);
577 y.push_back(yeval);
578 xeval += dx;
579 }
580 // pad window AFTER sampling
581 // std::cerr<<"we have xmin xmax ymin ymax "<<xmin<<" "<<xmax<<" "<<ymin<<" "<<ymax<<std::endl;
582 } else {
583 xmin = -1;
584 xmax = 1;
585 ymin = -1;
586 ymax = 1;
587 }
588 // std::cerr<<"we have xmin xmax ymin ymax "<<xmin<<" "<<xmax<<" "<<ymin<<" "<<ymax<<std::endl;
589 }
590 #endif
591 };
592
593 AnimCurveControl::AnimCurveControl(int id, AnimCurveEditable* editable)
594 : ExprControl(id, editable, false), _editable(editable) {
595
596 _preview = new ExprGraphPreview();
597 _preview->setMinimumWidth(200);
598 _preview->setMinimumHeight(60);
599 hbox->addWidget(_preview);
600 // QPushButton* button=new QPushButton();
601 // button->setIcon(QIcon(QPixmap(graphXPM)));
602 Q_UNUSED(graphXPM)
603 QPushButton* refreshButton = new QPushButton();
604 refreshButton->setMaximumWidth(30);
605 refreshButton->setIcon(QIcon(QPixmap(refreshXPM)));
606 QPushButton* expandButton = new QPushButton(">");
607 expandButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
608 expandButton->setFixedWidth(15);
609 hbox->addWidget(expandButton);
610 // hbox->addWidget(button);
611 refreshButton->setVisible(_editable->link != "");
612 hbox->addWidget(refreshButton);
613
614 #ifdef SEEXPR_USE_ANIMLIB
615 _preview->sample(editable->curve);
616 #endif
617 connect(expandButton, SIGNAL(clicked()), this, SLOT(editGraphClicked()));
618 // connect(_preview,SIGNAL(clicked()),this,SLOT(editGraphClicked()));
619 connect(refreshButton, SIGNAL(clicked()), this, SLOT(refreshClicked()));
620 }
621
622 #ifdef SEEXPR_USE_ANIMLIB
623 #include <CE/CETool.h>
624 #endif
625
626 void AnimCurveControl::refreshClicked() {
627 if (callback) {
628 #ifdef SEEXPR_USE_ANIMLIB
629 callback(_editable->link, _editable->curve);
630 _preview->sample(_editable->curve);
631 _preview->repaint();
632 emit controlChanged(_id);
633 #endif
634 }
635 }
636
637 void AnimCurveControl::editGraphClicked() {
638 #ifdef SEEXPR_USE_ANIMLIB
639 QDialog* dialog = new QDialog(this);
640 CETool* tool = new CETool;
641 animlib::AnimAttrID attr1("", "");
642 animlib::AnimCurve& anim = *new animlib::AnimCurve(attr1);
643 anim = _editable->curve;
644
645 QWidget* widg;
646 tool->map(widg, 0);
647 QVBoxLayout* layout = new QVBoxLayout();
648 dialog->resize(QSize(1024, 640));
649 dialog->setLayout(layout);
650 layout->addWidget(widg);
651 tool->addCurve(&anim);
652
653 QDialogButtonBox* buttonbar = new QDialogButtonBox();
654 buttonbar->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
655 connect(buttonbar, SIGNAL(accepted()), dialog, SLOT(accept()));
656 connect(buttonbar, SIGNAL(rejected()), dialog, SLOT(reject()));
657 layout->addWidget(buttonbar);
658
659 if (dialog->exec() == QDialog::Accepted) {
660 // copy points back from child
661 _editable->curve = anim;
662 _preview->sample(_editable->curve);
663 _preview->repaint();
664 emit controlChanged(_id);
665 }
666 #endif
667 }
668
669 void AnimCurveControl::setAnimCurveCallback(AnimCurveCallback newCallback) { callback = newCallback; }
670
671 AnimCurveControl::AnimCurveCallback AnimCurveControl::callback = 0;
672
673 // Editing widget for color swatch
674 ColorSwatchControl::ColorSwatchControl(int id, ColorSwatchEditable* editable)
675 : ExprControl(id, editable, false), _swatchEditable(editable), _indexLabel(false) {
676 // include index labels if user specifies 'indices' as labelType
677 if (_swatchEditable->labelType == "indices") _indexLabel = true;
678 buildSwatchWidget();
679 }
680
681 void ColorSwatchControl::colorChanged(int index, SeExpr2::Vec3d value) {
682 if (_updating) return;
683 if (index >= 0 && index < int(_swatchEditable->colors.size())) _swatchEditable->change(index, value);
684 emit controlChanged(_id);
685 }
686
687 void ColorSwatchControl::colorAdded(int index, SeExpr2::Vec3d value) {
688 if (_updating) return;
689 if (index >= 0 && index <= int(_swatchEditable->colors.size()))
690 _swatchEditable->add(value); // add to end; TODO insert
691 emit controlChanged(_id);
692 }
693
694 void ColorSwatchControl::colorRemoved(int index) {
695 if (_updating) return;
696 if (index >= 0 && index < int(_swatchEditable->colors.size())) {
697 _swatchEditable->remove(index);
698 _swatch->deleteLater();
699 _swatch = 0;
700 buildSwatchWidget();
701 }
702 emit controlChanged(_id);
703 }
704
705 void ColorSwatchControl::buildSwatchWidget() {
706 _swatch = new ExprColorSwatchWidget(_indexLabel, this);
707 connect(_swatch, SIGNAL(swatchChanged(int, SeExpr2::Vec3d)), this, SLOT(colorChanged(int, SeExpr2::Vec3d)));
708 connect(_swatch, SIGNAL(swatchAdded(int, SeExpr2::Vec3d)), this, SLOT(colorAdded(int, SeExpr2::Vec3d)));
709 connect(_swatch, SIGNAL(swatchRemoved(int)), this, SLOT(colorRemoved(int)));
710
711 _updating = true;
712 for (unsigned int i = 0; i < _swatchEditable->colors.size(); i++) {
713 SeExpr2::Vec3d val = _swatchEditable->colors[i];
714 _swatch->addSwatch(val, i);
715 }
716 _updating = false;
717 hbox->addWidget(_swatch);
718 }
719
720 DeepWaterControl::DeepWaterControl(int id, DeepWaterEditable* editable)
721 : ExprControl(id, editable, false), _deepWaterEditable(editable) {
722 _deepWater = new ExprDeepWater(this);
723 _deepWater->setParams(editable->params);
724
725 hbox->addWidget(_deepWater, 3);
726 connect(_deepWater->_scene, SIGNAL(deepWaterChanged()), SLOT(deepWaterChanged()));
727 }
728
729 void DeepWaterControl::deepWaterChanged() {
730 if (_deepWater && _deepWaterEditable) {
731 _deepWaterEditable->params = _deepWater->_scene->params;
732 emit controlChanged(_id);
733 }
734 }
ColorSwatchEditable::labelType
std::string labelType
Definition: Editable.h:276
graphXPM
static const char * graphXPM[]
Definition: ExprControl.cpp:65
CCurveControl::getColor
QColor getColor()
Interface for getting the color (used for linked color picking)
Definition: ExprControl.cpp:471
ExprColorCurve
Definition: ExprColorCurve.h:137
ExprDeepWater
Definition: ExprDeepWater.h:248
CurveControl::curveChanged
void curveChanged()
Definition: ExprControl.cpp:442
index
The result is computed int int< br >< div style="margin-left: 40px;"> Picks values randomly between loRange and hiRange based on supplied index(which is automatically hashed). &nbsp
ExprControl::linkStateChange
void linkStateChange(int state)
Definition: ExprControl.cpp:194
AnimCurveControl::setAnimCurveCallback
static void setAnimCurveCallback(AnimCurveCallback callback)
Definition: ExprControl.cpp:669
ExprGraphPreview::y
std::vector< float > y
Definition: ExprControl.cpp:476
SeExpr2::Curve::CV::_val
T _val
Definition: Curve.h:54
ColorSwatchEditable::colors
std::vector< SeExpr2::Vec3d > colors
Definition: Editable.h:275
AnimCurveEditable
Definition: Editable.h:211
ExprGraphPreview::ymin
float ymin
Definition: ExprControl.cpp:478
VectorEditable
Definition: Editable.h:101
VectorEditable::v
SeExpr2::Vec3d v
Definition: Editable.h:102
DeepWaterControl::DeepWaterControl
DeepWaterControl(int id, DeepWaterEditable *stringEditable)
Definition: ExprControl.cpp:720
Editable
Definition: Editable.h:40
CurveControl::CurveControl
CurveControl(int id, CurveEditable *stringEditable)
Definition: ExprControl.cpp:427
VectorControl::setColor
void setColor(QColor color)
Interface for setting the color (used for linked color picking)
Definition: ExprControl.cpp:323
ExprControl::_colorLinkCB
QCheckBox * _colorLinkCB
Definition: ExprControl.h:61
NumberControl::setValue
void setValue(float value)
Update the model with the value and notify the collection.
Definition: ExprControl.cpp:265
AnimCurveControl::refreshClicked
void refreshClicked()
Definition: ExprControl.cpp:626
NumberEditable::max
double max
Definition: Editable.h:62
Editable.h
ExprControl::_updating
bool _updating
Definition: ExprControl.h:59
ColorSwatchEditable
Definition: Editable.h:274
SeExpr2::Vec< double, 3, false >
ExprChannelSlider::paintEvent
virtual void paintEvent(QPaintEvent *e)
Definition: ExprControl.cpp:146
ColorSwatchControl::_indexLabel
bool _indexLabel
Definition: ExprControl.h:325
ExprControl::linkColorEdited
void linkColorEdited(int id, QColor color)
ExprGraphPreview::ExprGraphPreview
ExprGraphPreview(QWidget *parent=0)
Definition: ExprControl.cpp:482
NumberControl::updateControl
void updateControl()
Update values in slider and textbox given what the model contains.
Definition: ExprControl.cpp:257
StringControl::fileBrowse
void fileBrowse()
Definition: ExprControl.cpp:404
ExprControl::hbox
QHBoxLayout * hbox
Definition: ExprControl.h:60
AnimCurveEditable::link
std::string link
Definition: Editable.h:217
ColorSwatchControl::_swatch
ExprColorSwatchWidget * _swatch
Edit box for the color swatches.
Definition: ExprControl.h:313
CurveControl::_curveEditable
CurveEditable * _curveEditable
curve model
Definition: ExprControl.h:252
ColorSwatchControl::buildSwatchWidget
void buildSwatchWidget()
Definition: ExprControl.cpp:705
StringEditable::type
std::string type
Definition: Editable.h:136
StringControl::_edit
QLineEdit * _edit
Edit box for the string.
Definition: ExprControl.h:233
ExprControl::linkColorLink
void linkColorLink(int id)
ExprChannelSlider::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *e)
Definition: ExprControl.cpp:157
ExprGraphPreview::win_ymin
float win_ymin
Definition: ExprControl.cpp:479
NumberControl::sliderChanged
void sliderChanged(int val)
Definition: ExprControl.cpp:243
ExprCurve::addPoint
void addPoint(const double x, const double y, const T_INTERP interp, bool select=false)
Definition: ExprCurve.cpp:442
ExprFileDialog::getExistingDirectory
QString getExistingDirectory(const QString &caption=QString::null, const QString &startWith=QString::null, const QString &filter=QString::null)
Definition: ExprFileDialog.cpp:274
CCurveControl::curveChanged
void curveChanged()
Definition: ExprControl.cpp:464
ExprGraphPreview::cpy
std::vector< float > cpy
Definition: ExprControl.cpp:477
AnimCurveControl::_preview
ExprGraphPreview * _preview
Definition: ExprControl.h:287
Editable::name
std::string name
Definition: Editable.h:41
NumberControl::editChanged
void editChanged(int id, const QString &text)
Definition: ExprControl.cpp:248
ExprChannelSlider::setValue
void setValue(float value)
Definition: ExprControl.cpp:159
StringControl::textChanged
void textChanged(const QString &newText)
Definition: ExprControl.cpp:421
AnimCurveControl::callback
static AnimCurveCallback callback
Definition: ExprControl.h:303
ExprGraphPreview::cpx
std::vector< float > cpx
Definition: ExprControl.cpp:477
ExprChannelSlider::ExprChannelSlider
ExprChannelSlider(int id, QWidget *parent)
Definition: ExprControl.cpp:144
VectorControl::swatchChanged
void swatchChanged(QColor color)
Definition: ExprControl.cpp:310
ExprGraphPreview::ymax
float ymax
Definition: ExprControl.cpp:478
ExprCSwatchFrame::getValue
SeExpr2::Vec3d getValue() const
Definition: ExprColorCurve.cpp:326
ExprGraphPreview::paintEvent
void paintEvent(QPaintEvent *event)
Definition: ExprControl.cpp:491
CCurveScene::_cvs
std::vector< T_CURVE::CV > _cvs
Definition: ExprColorCurve.h:70
VectorEditable::isColor
bool isColor
Definition: Editable.h:104
AnimCurveControl::AnimCurveControl
AnimCurveControl(int id, AnimCurveEditable *curveEditable)
Definition: ExprControl.cpp:593
ExprColorCurve::_scene
CCurveScene * _scene
Definition: ExprColorCurve.h:156
ExprLineEdit::setText
virtual void setText(const QString &t)
Definition: ExprControl.h:108
ExprControl::linkDisconnect
void linkDisconnect(int newId)
Definition: ExprControl.cpp:205
SeExpr2::Curve::CV::_pos
double _pos
Definition: Curve.h:53
SeExpr2::Curve::CV::_interp
InterpType _interp
Definition: Curve.h:55
AnimCurveControl::editGraphClicked
void editGraphClicked()
Definition: ExprControl.cpp:637
ExprColorCurve::getSwatchColor
QColor getSwatchColor()
Definition: ExprColorCurve.cpp:495
ExprSlider::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *e)
Definition: ExprControl.cpp:95
ExprGraphPreview::toScreen
QPointF toScreen(float x, float y)
Definition: ExprControl.cpp:489
ExprChannelSlider::_id
int _id
Definition: ExprControl.h:165
ExprCSwatchFrame
Definition: ExprColorCurve.h:115
ExprChannelSlider::_col
QColor _col
Definition: ExprControl.h:167
ExprDeepWater::setParams
void setParams(const SeDeepWaterParams &params)
Definition: ExprDeepWater.cpp:456
DeepWaterControl::deepWaterChanged
void deepWaterChanged()
Definition: ExprControl.cpp:729
ExprChannelSlider::valueChanged
void valueChanged(int id, float value)
ExprColorSwatchWidget
Definition: ExprColorSwatch.h:54
ExprGraphPreview::win_xmax
float win_xmax
Definition: ExprControl.cpp:479
ExprControl::controlChanged
void controlChanged(int id)
NumberControl::NumberControl
NumberControl(int id, NumberEditable *number)
Definition: ExprControl.cpp:213
DeepWaterControl::_deepWaterEditable
DeepWaterEditable * _deepWaterEditable
curve model
Definition: ExprControl.h:333
CCurveControl::CCurveControl
CCurveControl(int id, ColorCurveEditable *stringEditable)
Definition: ExprControl.cpp:449
refreshXPM
static const char * refreshXPM[]
Definition: ExprControl.cpp:55
SeExpr2::min
double min(double x, double y)
Definition: ExprBuiltins.h:43
ColorSwatchControl::_swatchEditable
ColorSwatchEditable * _swatchEditable
model for the color swatches control
Definition: ExprControl.h:311
CCurveControl::setColor
void setColor(QColor color)
Interface for setting the color (used for linked color picking)
Definition: ExprControl.cpp:473
VectorControl::setValue
void setValue(int id, float value)
set the value in the model (in response to editing from controls)
Definition: ExprControl.cpp:367
VectorEditable::min
double min
Definition: Editable.h:103
ExprChannelSlider
Channel Slider (i.e. for colors)
Definition: ExprControl.h:146
fileXPM
static const char * fileXPM[]
Definition: ExprControl.cpp:84
VectorEditable::max
double max
Definition: Editable.h:103
DeepWaterScene::params
SeDeepWaterParams params
Definition: ExprDeepWater.h:218
AnimCurveControl::_editable
AnimCurveEditable * _editable
Definition: ExprControl.h:284
ColorSwatchControl::colorChanged
void colorChanged(int index, SeExpr2::Vec3d value)
Definition: ExprControl.cpp:681
ColorSwatchEditable::change
void change(int index, const SeExpr2::Vec3d &value)
Definition: Editable.h:315
NumberEditable
Definition: Editable.h:60
SeExpr2::clamp
double clamp(double x, double lo, double hi)
Definition: ExprBuiltins.h:40
ExprColorCurve::addPoint
void addPoint(const double x, const SeExpr2::Vec3d y, const T_INTERP interp, bool select=false)
Definition: ExprColorCurve.cpp:485
ColorSwatchControl::ColorSwatchControl
ColorSwatchControl(int id, ColorSwatchEditable *swatchEditable)
Definition: ExprControl.cpp:674
ColorSwatchEditable::remove
void remove(int index)
Definition: Editable.h:317
StringControl::directoryBrowse
void directoryBrowse()
Definition: ExprControl.cpp:412
NumberEditable::min
double min
Definition: Editable.h:62
ExprControl::_id
int _id
Definition: ExprControl.h:55
ExprChannelSlider::setDisplayColor
void setDisplayColor(QColor c)
Definition: ExprControl.h:155
ExprGraphPreview::xmax
float xmax
Definition: ExprControl.cpp:478
ColorSwatchControl::colorAdded
void colorAdded(int index, SeExpr2::Vec3d value)
Definition: ExprControl.cpp:687
VectorControl::VectorControl
VectorControl(int id, VectorEditable *number)
Definition: ExprControl.cpp:273
CCurveControl::_curve
ExprColorCurve * _curve
color curve widget
Definition: ExprControl.h:270
VectorControl::_sliders
ExprChannelSlider * _sliders[3]
All three channel sliders (for each component)
Definition: ExprControl.h:204
DeepWaterEditable::params
SeDeepWaterParams params
Definition: Editable.h:328
SeExpr2::max
double max(double x, double y)
Definition: ExprBuiltins.h:42
NumberControl::_edit
ExprLineEdit * _edit
Text box for the number.
Definition: ExprControl.h:179
directoryXPM
static const char * directoryXPM[]
Definition: ExprControl.cpp:75
value
For any rgb or hsl value(except for negative s values)
ExprChannelSlider::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Definition: ExprControl.cpp:155
NumberEditable::isInt
bool isInt
Definition: Editable.h:63
ExprChannelSlider::value
float value() const
Definition: ExprControl.h:154
ExprColorCurve.h
r
</pre > To parallelize evaluation per a simple parallel_for can be p blocked_range r
Definition: varblocks.txt:76
VectorControl::sliderChanged
void sliderChanged(int id, float val)
Definition: ExprControl.cpp:329
ExprGraphPreview::dx
float dx
Definition: ExprControl.cpp:478
ExprControl::_label
QLabel * _label
Definition: ExprControl.h:62
ColorSwatchEditable::add
void add(const SeExpr2::Vec3d &value)
Definition: Editable.h:313
ExprGraphPreview::win_ymax
float win_ymax
Definition: ExprControl.cpp:479
DeepWaterEditable
Definition: Editable.h:327
ExprColorSwatchWidget::addSwatch
void addSwatch(SeExpr2::Vec3d &val, int index=-1)
Definition: ExprColorSwatch.cpp:147
VectorControl::_edits
ExprLineEdit * _edits[3]
All three line edit widgets (for each component)
Definition: ExprControl.h:202
CurveScene::_cvs
std::vector< T_CURVE::CV > _cvs
Definition: ExprCurve.h:88
ExprGraphPreview
Definition: ExprControl.cpp:475
VectorControl::_swatch
ExprCSwatchFrame * _swatch
Definition: ExprControl.h:203
VectorControl::_numberEditable
VectorEditable * _numberEditable
Number model.
Definition: ExprControl.h:200
VectorControl::editChanged
void editChanged(int id, const QString &text)
Definition: ExprControl.cpp:335
ExprGraphPreview::win_dy
float win_dy
Definition: ExprControl.cpp:479
ExprGraphPreview::win_xmin
float win_xmin
Definition: ExprControl.cpp:479
DeepWaterControl::_deepWater
ExprDeepWater * _deepWater
deep water widget
Definition: ExprControl.h:335
ExprLineEdit
Line Editor Widget(used for numbers)
Definition: ExprControl.h:104
CCurveControl::_curveEditable
ColorCurveEditable * _curveEditable
color curve model
Definition: ExprControl.h:268
AnimCurveControl::AnimCurveCallback
void(* AnimCurveCallback)(const std::string &, animlib::AnimCurve &curve)
Definition: ExprControl.h:291
GenericCurveEditable::cvs
std::vector< CV > cvs
Definition: Editable.h:175
ExprGraphPreview::win_dx
float win_dx
Definition: ExprControl.cpp:479
StringControl::StringControl
StringControl(int id, StringEditable *stringEditable)
Definition: ExprControl.cpp:376
VectorControl::updateControl
void updateControl()
update the individual slider and eidt box controls
Definition: ExprControl.cpp:343
ExprChannelSlider::_value
float _value
Definition: ExprControl.h:166
ColorSwatchControl::colorRemoved
void colorRemoved(int index)
Definition: ExprControl.cpp:694
ExprControl::ExprControl
ExprControl(int id, Editable *editable, bool showColorLink)
Definition: ExprControl.cpp:166
ExprControl.h
ExprFileDialog::getOpenFileName
QString getOpenFileName(const QString &caption=QString::null, const QString &startWith=QString::null, const QString &filter=QString::null)
Definition: ExprFileDialog.cpp:229
p
static const int p[514]
Definition: NoiseTables.h:20
ExprFileDialog
Definition: ExprFileDialog.h:42
ExprSlider::paintEvent
virtual void paintEvent(QPaintEvent *e)
Definition: ExprControl.cpp:102
NumberEditable::v
double v
Definition: Editable.h:61
ExprControl
Base class for all controls for Expressions.
Definition: ExprControl.h:54
StringEditable
Definition: Editable.h:134
ExprColorSwatch.h
ExprSlider
Generic Slider (used for int and float sliders)
Definition: ExprControl.h:126
StringControl::updateControl
void updateControl()
Definition: ExprControl.cpp:419
GenericCurveEditable
Definition: Editable.h:170
ExprCurve
Definition: ExprCurve.h:116
ExprGraphPreview::x
std::vector< float > x
Definition: ExprControl.cpp:476
ExprDeepWater::_scene
DeepWaterScene * _scene
Definition: ExprDeepWater.h:255
ExprCurve::_scene
CurveScene * _scene
Definition: ExprCurve.h:133
NumberControl::_numberEditable
NumberEditable * _numberEditable
Pointer to the number control model.
Definition: ExprControl.h:175
ExprFileDialog.h
VectorControl::getColor
QColor getColor()
Interface for getting the color (used for linked color picking)
Definition: ExprControl.cpp:318
SeExpr2::curve
SeExpr2::CurveFuncX curve
ExprGraphPreview::xmin
float xmin
Definition: ExprControl.cpp:478
ExprFileDialog::setPreview
void setPreview()
Definition: ExprFileDialog.cpp:327
x
</pre >< h3 > A simple variable reference</h3 > This is not a very interesting subclass of expression until we add some additional variables Variables on some applications may be very dynamic In this we only need x
Definition: tutorial.txt:108
b
Between a and b
Definition: userdoc.txt:180
ExprCSwatchFrame::setValue
void setValue(const SeExpr2::Vec3d &value)
Definition: ExprColorCurve.cpp:319
ExprSlider::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Definition: ExprControl.cpp:93
StringEditable::v
std::string v
Definition: Editable.h:135
SeExpr2::Curve::CV
Definition: Curve.h:50
ExprControl::getColor
virtual QColor getColor()
Interface for getting the color (used for linked color picking)
Definition: ExprControl.h:71
CurveControl::_curve
ExprCurve * _curve
curve edit widget
Definition: ExprControl.h:254
StringControl::_stringEditable
StringEditable * _stringEditable
model for the string control
Definition: ExprControl.h:231
ExprGraphPreview::dy
float dy
Definition: ExprControl.cpp:478
NumberControl::_slider
ExprSlider * _slider
Slider for the number.
Definition: ExprControl.h:177
ExprColorCurve::setSwatchColor
void setSwatchColor(QColor color)
Definition: ExprColorCurve.cpp:489