Mercurial > hg > svgui
comparison layer/TimeValueLayer.cpp @ 682:1a0dfcbffaf1
Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 14:06:40 +0000 |
parents | d52751e2728b |
children | 5674950ed82a |
comparison
equal
deleted
inserted
replaced
681:eaf4446a1bef | 682:1a0dfcbffaf1 |
---|---|
79 if (m_model && m_model->getRDFTypeURI().endsWith("Change")) { | 79 if (m_model && m_model->getRDFTypeURI().endsWith("Change")) { |
80 setPlotStyle(PlotSegmentation); | 80 setPlotStyle(PlotSegmentation); |
81 } | 81 } |
82 | 82 |
83 #ifdef DEBUG_TIME_VALUE_LAYER | 83 #ifdef DEBUG_TIME_VALUE_LAYER |
84 std::cerr << "TimeValueLayer::setModel(" << model << ")" << std::endl; | 84 cerr << "TimeValueLayer::setModel(" << model << ")" << endl; |
85 #endif | 85 #endif |
86 | 86 |
87 emit modelReplaced(); | 87 emit modelReplaced(); |
88 } | 88 } |
89 | 89 |
332 max = std::max(fabsf(min), fabsf(max)); | 332 max = std::max(fabsf(min), fabsf(max)); |
333 min = -max; | 333 min = -max; |
334 } | 334 } |
335 | 335 |
336 #ifdef DEBUG_TIME_VALUE_LAYER | 336 #ifdef DEBUG_TIME_VALUE_LAYER |
337 std::cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << std::endl; | 337 cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << endl; |
338 #endif | 338 #endif |
339 | 339 |
340 if (!shouldAutoAlign() && !logarithmic && !m_derivative) { | 340 if (!shouldAutoAlign() && !logarithmic && !m_derivative) { |
341 | 341 |
342 if (max == min) { | 342 if (max == min) { |
347 max = max + margin; | 347 max = max + margin; |
348 min = min - margin; | 348 min = min - margin; |
349 } | 349 } |
350 | 350 |
351 #ifdef DEBUG_TIME_VALUE_LAYER | 351 #ifdef DEBUG_TIME_VALUE_LAYER |
352 std::cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << " (after adjustment)" << std::endl; | 352 cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << " (after adjustment)" << endl; |
353 #endif | 353 #endif |
354 } | 354 } |
355 | 355 |
356 return true; | 356 return true; |
357 } | 357 } |
374 max = std::max(fabsf(min), fabsf(max)); | 374 max = std::max(fabsf(min), fabsf(max)); |
375 min = -max; | 375 min = -max; |
376 } | 376 } |
377 | 377 |
378 #ifdef DEBUG_TIME_VALUE_LAYER | 378 #ifdef DEBUG_TIME_VALUE_LAYER |
379 std::cerr << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << std::endl; | 379 cerr << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << endl; |
380 #endif | 380 #endif |
381 | 381 |
382 return true; | 382 return true; |
383 } | 383 } |
384 | 384 |
397 | 397 |
398 m_scaleMinimum = min; | 398 m_scaleMinimum = min; |
399 m_scaleMaximum = max; | 399 m_scaleMaximum = max; |
400 | 400 |
401 #ifdef DEBUG_TIME_VALUE_LAYER | 401 #ifdef DEBUG_TIME_VALUE_LAYER |
402 std::cerr << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl; | 402 cerr << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << endl; |
403 #endif | 403 #endif |
404 | 404 |
405 emit layerParametersChanged(); | 405 emit layerParametersChanged(); |
406 return true; | 406 return true; |
407 } | 407 } |
429 getDisplayExtents(dmin, dmax); | 429 getDisplayExtents(dmin, dmax); |
430 | 430 |
431 int nr = mapper->getPositionForValue(dmax - dmin); | 431 int nr = mapper->getPositionForValue(dmax - dmin); |
432 | 432 |
433 #ifdef DEBUG_TIME_VALUE_LAYER | 433 #ifdef DEBUG_TIME_VALUE_LAYER |
434 std::cerr << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << std::endl; | 434 cerr << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << endl; |
435 #endif | 435 #endif |
436 | 436 |
437 delete mapper; | 437 delete mapper; |
438 | 438 |
439 return 100 - nr; | 439 return 100 - nr; |
466 | 466 |
467 newmax = (newdist + sqrtf(newdist*newdist + 4*dmin*dmax)) / 2; | 467 newmax = (newdist + sqrtf(newdist*newdist + 4*dmin*dmax)) / 2; |
468 newmin = newmax - newdist; | 468 newmin = newmax - newdist; |
469 | 469 |
470 #ifdef DEBUG_TIME_VALUE_LAYER | 470 #ifdef DEBUG_TIME_VALUE_LAYER |
471 std::cerr << "newmin = " << newmin << ", newmax = " << newmax << std::endl; | 471 cerr << "newmin = " << newmin << ", newmax = " << newmax << endl; |
472 #endif | 472 #endif |
473 | 473 |
474 } else { | 474 } else { |
475 float dmid = (dmax + dmin) / 2; | 475 float dmid = (dmax + dmin) / 2; |
476 newmin = dmid - newdist / 2; | 476 newmin = dmid - newdist / 2; |
484 if (newmax > max) { | 484 if (newmax > max) { |
485 newmax = max; | 485 newmax = max; |
486 } | 486 } |
487 | 487 |
488 #ifdef DEBUG_TIME_VALUE_LAYER | 488 #ifdef DEBUG_TIME_VALUE_LAYER |
489 std::cerr << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl; | 489 cerr << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl; |
490 #endif | 490 #endif |
491 | 491 |
492 setDisplayExtents(newmin, newmax); | 492 setDisplayExtents(newmin, newmax); |
493 } | 493 } |
494 | 494 |
790 log = true; | 790 log = true; |
791 } | 791 } |
792 } | 792 } |
793 | 793 |
794 #ifdef DEBUG_TIME_VALUE_LAYER | 794 #ifdef DEBUG_TIME_VALUE_LAYER |
795 std::cerr << "TimeValueLayer::getScaleExtents: min = " << min << ", max = " << max << std::endl; | 795 cerr << "TimeValueLayer::getScaleExtents: min = " << min << ", max = " << max << endl; |
796 #endif | 796 #endif |
797 } | 797 } |
798 | 798 |
799 int | 799 int |
800 TimeValueLayer::getYForValue(View *v, float val) const | 800 TimeValueLayer::getYForValue(View *v, float val) const |
804 int h = v->height(); | 804 int h = v->height(); |
805 | 805 |
806 getScaleExtents(v, min, max, logarithmic); | 806 getScaleExtents(v, min, max, logarithmic); |
807 | 807 |
808 #ifdef DEBUG_TIME_VALUE_LAYER | 808 #ifdef DEBUG_TIME_VALUE_LAYER |
809 std::cerr << "getYForValue(" << val << "): min " << min << ", max " | 809 cerr << "getYForValue(" << val << "): min " << min << ", max " |
810 << max << ", log " << logarithmic << std::endl; | 810 << max << ", log " << logarithmic << endl; |
811 #endif | 811 #endif |
812 | 812 |
813 if (logarithmic) { | 813 if (logarithmic) { |
814 val = LogRange::map(val); | 814 val = LogRange::map(val); |
815 } | 815 } |
856 if (log) { | 856 if (log) { |
857 val = LogRange::map(val); | 857 val = LogRange::map(val); |
858 } | 858 } |
859 | 859 |
860 #ifdef DEBUG_TIME_VALUE_LAYER | 860 #ifdef DEBUG_TIME_VALUE_LAYER |
861 std::cerr << "TimeValueLayer::getColourForValue: min " << min << ", max " | 861 cerr << "TimeValueLayer::getColourForValue: min " << min << ", max " |
862 << max << ", log " << log << ", value " << val << std::endl; | 862 << max << ", log " << log << ", value " << val << endl; |
863 #endif | 863 #endif |
864 | 864 |
865 QColor solid = ColourMapper(m_colourMap, min, max).map(val); | 865 QColor solid = ColourMapper(m_colourMap, min, max).map(val); |
866 return QColor(solid.red(), solid.green(), solid.blue(), 120); | 866 return QColor(solid.red(), solid.green(), solid.blue(), 120); |
867 } | 867 } |
900 QColor brushColour(getBaseQColor()); | 900 QColor brushColour(getBaseQColor()); |
901 brushColour.setAlpha(80); | 901 brushColour.setAlpha(80); |
902 paint.setBrush(brushColour); | 902 paint.setBrush(brushColour); |
903 | 903 |
904 #ifdef DEBUG_TIME_VALUE_LAYER | 904 #ifdef DEBUG_TIME_VALUE_LAYER |
905 std::cerr << "TimeValueLayer::paint: resolution is " | 905 cerr << "TimeValueLayer::paint: resolution is " |
906 << m_model->getResolution() << " frames" << std::endl; | 906 << m_model->getResolution() << " frames" << endl; |
907 #endif | 907 #endif |
908 | 908 |
909 float min = m_model->getValueMinimum(); | 909 float min = m_model->getValueMinimum(); |
910 float max = m_model->getValueMaximum(); | 910 float max = m_model->getValueMaximum(); |
911 if (max == min) max = min + 1.0; | 911 if (max == min) max = min + 1.0; |
918 | 918 |
919 if (v->shouldIlluminateLocalFeatures(this, localPos)) { | 919 if (v->shouldIlluminateLocalFeatures(this, localPos)) { |
920 SparseTimeValueModel::PointList localPoints = | 920 SparseTimeValueModel::PointList localPoints = |
921 getLocalPoints(v, localPos.x()); | 921 getLocalPoints(v, localPos.x()); |
922 #ifdef DEBUG_TIME_VALUE_LAYER | 922 #ifdef DEBUG_TIME_VALUE_LAYER |
923 std::cerr << "TimeValueLayer: " << localPoints.size() << " local points" << std::endl; | 923 cerr << "TimeValueLayer: " << localPoints.size() << " local points" << endl; |
924 #endif | 924 #endif |
925 if (!localPoints.empty()) illuminateFrame = localPoints.begin()->frame; | 925 if (!localPoints.empty()) illuminateFrame = localPoints.begin()->frame; |
926 } | 926 } |
927 | 927 |
928 int w = | 928 int w = |
1002 nx = v->getXForFrame(nf); | 1002 nx = v->getXForFrame(nf); |
1003 ny = getYForValue(v, nvalue); | 1003 ny = getYForValue(v, nvalue); |
1004 haveNext = true; | 1004 haveNext = true; |
1005 } | 1005 } |
1006 | 1006 |
1007 // std::cout << "frame = " << p.frame << ", x = " << x << ", haveNext = " << haveNext | 1007 // cout << "frame = " << p.frame << ", x = " << x << ", haveNext = " << haveNext |
1008 // << ", nx = " << nx << std::endl; | 1008 // << ", nx = " << nx << endl; |
1009 | 1009 |
1010 if (m_plotStyle == PlotDiscreteCurves) { | 1010 if (m_plotStyle == PlotDiscreteCurves) { |
1011 paint.setPen(QPen(getBaseQColor(), 3)); | 1011 paint.setPen(QPen(getBaseQColor(), 3)); |
1012 paint.setBrush(Qt::NoBrush); | 1012 paint.setBrush(Qt::NoBrush); |
1013 } else if (m_plotStyle == PlotSegmentation) { | 1013 } else if (m_plotStyle == PlotSegmentation) { |
1130 } | 1130 } |
1131 | 1131 |
1132 if (m_plotStyle == PlotSegmentation) { | 1132 if (m_plotStyle == PlotSegmentation) { |
1133 | 1133 |
1134 #ifdef DEBUG_TIME_VALUE_LAYER | 1134 #ifdef DEBUG_TIME_VALUE_LAYER |
1135 std::cerr << "drawing rect" << std::endl; | 1135 cerr << "drawing rect" << endl; |
1136 #endif | 1136 #endif |
1137 | 1137 |
1138 if (nx <= x) continue; | 1138 if (nx <= x) continue; |
1139 | 1139 |
1140 paint.setPen(QPen(getForegroundQColor(v), 2)); | 1140 paint.setPen(QPen(getForegroundQColor(v), 2)); |
1261 int prec = trunc(log10f(inc)); | 1261 int prec = trunc(log10f(inc)); |
1262 prec -= 1; | 1262 prec -= 1; |
1263 if (prec < 0) dp = -prec; | 1263 if (prec < 0) dp = -prec; |
1264 round = powf(10.f, prec); | 1264 round = powf(10.f, prec); |
1265 #ifdef DEBUG_TIME_VALUE_LAYER | 1265 #ifdef DEBUG_TIME_VALUE_LAYER |
1266 std::cerr << "inc = " << inc << ", round = " << round << ", dp = " << dp << std::endl; | 1266 cerr << "inc = " << inc << ", round = " << round << ", dp = " << dp << endl; |
1267 #endif | 1267 #endif |
1268 } | 1268 } |
1269 | 1269 |
1270 int prevy = -1; | 1270 int prevy = -1; |
1271 | 1271 |
1284 v->height() < paint.fontMetrics().height() * (n*2)) { | 1284 v->height() < paint.fontMetrics().height() * (n*2)) { |
1285 if (m_model->getScaleUnits() != "") drawText = false; | 1285 if (m_model->getScaleUnits() != "") drawText = false; |
1286 } | 1286 } |
1287 dispval = lrintf(val / round) * round; | 1287 dispval = lrintf(val / round) * round; |
1288 #ifdef DEBUG_TIME_VALUE_LAYER | 1288 #ifdef DEBUG_TIME_VALUE_LAYER |
1289 std::cerr << "val = " << val << ", dispval = " << dispval << std::endl; | 1289 cerr << "val = " << val << ", dispval = " << dispval << endl; |
1290 #endif | 1290 #endif |
1291 if (logarithmic) { | 1291 if (logarithmic) { |
1292 y = getYForValue(v, LogRange::unmap(dispval)); | 1292 y = getYForValue(v, LogRange::unmap(dispval)); |
1293 } else { | 1293 } else { |
1294 y = getYForValue(v, dispval); | 1294 y = getYForValue(v, dispval); |
1340 | 1340 |
1341 void | 1341 void |
1342 TimeValueLayer::drawStart(View *v, QMouseEvent *e) | 1342 TimeValueLayer::drawStart(View *v, QMouseEvent *e) |
1343 { | 1343 { |
1344 #ifdef DEBUG_TIME_VALUE_LAYER | 1344 #ifdef DEBUG_TIME_VALUE_LAYER |
1345 std::cerr << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl; | 1345 cerr << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl; |
1346 #endif | 1346 #endif |
1347 | 1347 |
1348 if (!m_model) return; | 1348 if (!m_model) return; |
1349 | 1349 |
1350 long frame = v->getFrameForX(e->x()); | 1350 long frame = v->getFrameForX(e->x()); |
1360 if (!points.empty()) { | 1360 if (!points.empty()) { |
1361 for (SparseTimeValueModel::PointList::iterator i = points.begin(); | 1361 for (SparseTimeValueModel::PointList::iterator i = points.begin(); |
1362 i != points.end(); ++i) { | 1362 i != points.end(); ++i) { |
1363 if (((i->frame / resolution) * resolution) != frame) { | 1363 if (((i->frame / resolution) * resolution) != frame) { |
1364 #ifdef DEBUG_TIME_VALUE_LAYER | 1364 #ifdef DEBUG_TIME_VALUE_LAYER |
1365 std::cerr << "ignoring out-of-range frame at " << i->frame << std::endl; | 1365 cerr << "ignoring out-of-range frame at " << i->frame << endl; |
1366 #endif | 1366 #endif |
1367 continue; | 1367 continue; |
1368 } | 1368 } |
1369 m_editingPoint = *i; | 1369 m_editingPoint = *i; |
1370 havePoint = true; | 1370 havePoint = true; |
1390 | 1390 |
1391 void | 1391 void |
1392 TimeValueLayer::drawDrag(View *v, QMouseEvent *e) | 1392 TimeValueLayer::drawDrag(View *v, QMouseEvent *e) |
1393 { | 1393 { |
1394 #ifdef DEBUG_TIME_VALUE_LAYER | 1394 #ifdef DEBUG_TIME_VALUE_LAYER |
1395 std::cerr << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl; | 1395 cerr << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; |
1396 #endif | 1396 #endif |
1397 | 1397 |
1398 if (!m_model || !m_editing) return; | 1398 if (!m_model || !m_editing) return; |
1399 | 1399 |
1400 long frame = v->getFrameForX(e->x()); | 1400 long frame = v->getFrameForX(e->x()); |
1405 float value = getValueForY(v, e->y()); | 1405 float value = getValueForY(v, e->y()); |
1406 | 1406 |
1407 SparseTimeValueModel::PointList points = getLocalPoints(v, e->x()); | 1407 SparseTimeValueModel::PointList points = getLocalPoints(v, e->x()); |
1408 | 1408 |
1409 #ifdef DEBUG_TIME_VALUE_LAYER | 1409 #ifdef DEBUG_TIME_VALUE_LAYER |
1410 std::cerr << points.size() << " points" << std::endl; | 1410 cerr << points.size() << " points" << endl; |
1411 #endif | 1411 #endif |
1412 | 1412 |
1413 bool havePoint = false; | 1413 bool havePoint = false; |
1414 | 1414 |
1415 if (!points.empty()) { | 1415 if (!points.empty()) { |
1416 for (SparseTimeValueModel::PointList::iterator i = points.begin(); | 1416 for (SparseTimeValueModel::PointList::iterator i = points.begin(); |
1417 i != points.end(); ++i) { | 1417 i != points.end(); ++i) { |
1418 if (i->frame == m_editingPoint.frame && | 1418 if (i->frame == m_editingPoint.frame && |
1419 i->value == m_editingPoint.value) { | 1419 i->value == m_editingPoint.value) { |
1420 #ifdef DEBUG_TIME_VALUE_LAYER | 1420 #ifdef DEBUG_TIME_VALUE_LAYER |
1421 std::cerr << "ignoring current editing point at " << i->frame << ", " << i->value << std::endl; | 1421 cerr << "ignoring current editing point at " << i->frame << ", " << i->value << endl; |
1422 #endif | 1422 #endif |
1423 continue; | 1423 continue; |
1424 } | 1424 } |
1425 if (((i->frame / resolution) * resolution) != frame) { | 1425 if (((i->frame / resolution) * resolution) != frame) { |
1426 #ifdef DEBUG_TIME_VALUE_LAYER | 1426 #ifdef DEBUG_TIME_VALUE_LAYER |
1427 std::cerr << "ignoring out-of-range frame at " << i->frame << std::endl; | 1427 cerr << "ignoring out-of-range frame at " << i->frame << endl; |
1428 #endif | 1428 #endif |
1429 continue; | 1429 continue; |
1430 } | 1430 } |
1431 #ifdef DEBUG_TIME_VALUE_LAYER | 1431 #ifdef DEBUG_TIME_VALUE_LAYER |
1432 std::cerr << "adjusting to new point at " << i->frame << ", " << i->value << std::endl; | 1432 cerr << "adjusting to new point at " << i->frame << ", " << i->value << endl; |
1433 #endif | 1433 #endif |
1434 m_editingPoint = *i; | 1434 m_editingPoint = *i; |
1435 m_originalPoint = m_editingPoint; | 1435 m_originalPoint = m_editingPoint; |
1436 m_editingCommand->deletePoint(m_editingPoint); | 1436 m_editingCommand->deletePoint(m_editingPoint); |
1437 havePoint = true; | 1437 havePoint = true; |
1452 | 1452 |
1453 void | 1453 void |
1454 TimeValueLayer::drawEnd(View *, QMouseEvent *) | 1454 TimeValueLayer::drawEnd(View *, QMouseEvent *) |
1455 { | 1455 { |
1456 #ifdef DEBUG_TIME_VALUE_LAYER | 1456 #ifdef DEBUG_TIME_VALUE_LAYER |
1457 std::cerr << "TimeValueLayer::drawEnd" << std::endl; | 1457 cerr << "TimeValueLayer::drawEnd" << endl; |
1458 #endif | 1458 #endif |
1459 if (!m_model || !m_editing) return; | 1459 if (!m_model || !m_editing) return; |
1460 finish(m_editingCommand); | 1460 finish(m_editingCommand); |
1461 m_editingCommand = 0; | 1461 m_editingCommand = 0; |
1462 m_editing = false; | 1462 m_editing = false; |
1509 | 1509 |
1510 void | 1510 void |
1511 TimeValueLayer::editStart(View *v, QMouseEvent *e) | 1511 TimeValueLayer::editStart(View *v, QMouseEvent *e) |
1512 { | 1512 { |
1513 #ifdef DEBUG_TIME_VALUE_LAYER | 1513 #ifdef DEBUG_TIME_VALUE_LAYER |
1514 std::cerr << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; | 1514 cerr << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << endl; |
1515 #endif | 1515 #endif |
1516 | 1516 |
1517 if (!m_model) return; | 1517 if (!m_model) return; |
1518 | 1518 |
1519 SparseTimeValueModel::PointList points = getLocalPoints(v, e->x()); | 1519 SparseTimeValueModel::PointList points = getLocalPoints(v, e->x()); |
1532 | 1532 |
1533 void | 1533 void |
1534 TimeValueLayer::editDrag(View *v, QMouseEvent *e) | 1534 TimeValueLayer::editDrag(View *v, QMouseEvent *e) |
1535 { | 1535 { |
1536 #ifdef DEBUG_TIME_VALUE_LAYER | 1536 #ifdef DEBUG_TIME_VALUE_LAYER |
1537 std::cerr << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl; | 1537 cerr << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << endl; |
1538 #endif | 1538 #endif |
1539 | 1539 |
1540 if (!m_model || !m_editing) return; | 1540 if (!m_model || !m_editing) return; |
1541 | 1541 |
1542 long frame = v->getFrameForX(e->x()); | 1542 long frame = v->getFrameForX(e->x()); |
1558 | 1558 |
1559 void | 1559 void |
1560 TimeValueLayer::editEnd(View *, QMouseEvent *) | 1560 TimeValueLayer::editEnd(View *, QMouseEvent *) |
1561 { | 1561 { |
1562 #ifdef DEBUG_TIME_VALUE_LAYER | 1562 #ifdef DEBUG_TIME_VALUE_LAYER |
1563 std::cerr << "TimeValueLayer::editEnd" << std::endl; | 1563 cerr << "TimeValueLayer::editEnd" << endl; |
1564 #endif | 1564 #endif |
1565 if (!m_model || !m_editing) return; | 1565 if (!m_model || !m_editing) return; |
1566 | 1566 |
1567 if (m_editingCommand) { | 1567 if (m_editingCommand) { |
1568 | 1568 |
1898 | 1898 |
1899 if (i->haveValue()) { | 1899 if (i->haveValue()) { |
1900 newPoint.value = i->getValue(); | 1900 newPoint.value = i->getValue(); |
1901 } else { | 1901 } else { |
1902 #ifdef DEBUG_TIME_VALUE_LAYER | 1902 #ifdef DEBUG_TIME_VALUE_LAYER |
1903 std::cerr << "Setting value on point at " << newPoint.frame << " from labeller"; | 1903 cerr << "Setting value on point at " << newPoint.frame << " from labeller"; |
1904 if (i == points.begin()) { | 1904 if (i == points.begin()) { |
1905 std::cerr << ", no prev point" << std::endl; | 1905 cerr << ", no prev point" << endl; |
1906 } else { | 1906 } else { |
1907 std::cerr << ", prev point is at " << prevPoint.frame << std::endl; | 1907 cerr << ", prev point is at " << prevPoint.frame << endl; |
1908 } | 1908 } |
1909 #endif | 1909 #endif |
1910 labeller.setValue<SparseTimeValueModel::Point> | 1910 labeller.setValue<SparseTimeValueModel::Point> |
1911 (newPoint, (i == points.begin()) ? 0 : &prevPoint); | 1911 (newPoint, (i == points.begin()) ? 0 : &prevPoint); |
1912 #ifdef DEBUG_TIME_VALUE_LAYER | 1912 #ifdef DEBUG_TIME_VALUE_LAYER |
1913 std::cerr << "New point value = " << newPoint.value << std::endl; | 1913 cerr << "New point value = " << newPoint.value << endl; |
1914 #endif | 1914 #endif |
1915 if (labeller.actingOnPrevPoint() && i != points.begin()) { | 1915 if (labeller.actingOnPrevPoint() && i != points.begin()) { |
1916 usePrev = true; | 1916 usePrev = true; |
1917 } | 1917 } |
1918 } | 1918 } |
1971 setShowDerivative(derivative); | 1971 setShowDerivative(derivative); |
1972 | 1972 |
1973 float min = attributes.value("scaleMinimum").toFloat(&ok); | 1973 float min = attributes.value("scaleMinimum").toFloat(&ok); |
1974 float max = attributes.value("scaleMaximum").toFloat(&alsoOk); | 1974 float max = attributes.value("scaleMaximum").toFloat(&alsoOk); |
1975 #ifdef DEBUG_TIME_VALUE_LAYER | 1975 #ifdef DEBUG_TIME_VALUE_LAYER |
1976 std::cerr << "from properties: min = " << min << ", max = " << max << std::endl; | 1976 cerr << "from properties: min = " << min << ", max = " << max << endl; |
1977 #endif | 1977 #endif |
1978 if (ok && alsoOk && min != max) setDisplayExtents(min, max); | 1978 if (ok && alsoOk && min != max) setDisplayExtents(min, max); |
1979 } | 1979 } |
1980 | 1980 |