mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps] In CurveView, replace the virtual method evaluateModelWithParameter by a function given as parameter (to be able to call Curve view methods with different implementation of evaluateModelWithParameter)
This commit is contained in:
committed by
EmilieNumworks
parent
ea28475432
commit
ef8f5e07c2
@@ -29,7 +29,7 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
float windowRange = pixelToFloat(Axis::Horizontal, bounds().width()) - pixelToFloat(Axis::Horizontal, 0);
|
||||
int step = std::ceil(windowRange/resolution());
|
||||
for (int x = rectXMin; x < rectXMax; x += step) {
|
||||
float y = evaluateModelWithParameter(s, x);
|
||||
float y = s->evaluateAtAbscissa((float)x, context());
|
||||
if (std::isnan(y)) {
|
||||
continue;
|
||||
}
|
||||
@@ -92,11 +92,6 @@ float GraphView::samplingRatio() const {
|
||||
return 5.0f;
|
||||
}
|
||||
|
||||
float GraphView::evaluateModelWithParameter(Model * curve, float abscissa) const {
|
||||
Sequence * s = (Sequence *)curve;
|
||||
return s->evaluateAtAbscissa(abscissa, context());
|
||||
}
|
||||
|
||||
KDSize GraphView::cursorSize() {
|
||||
if (m_verticalCursor) {
|
||||
return KDSize(1, 0);
|
||||
|
||||
Reference in New Issue
Block a user