| 78 | } |
| 79 | |
| 80 | void Lissajous::DrawModule() |
| 81 | { |
| 82 | if (Minimized() || IsVisible() == false) |
| 83 | return; |
| 84 | |
| 85 | mScaleSlider->Draw(); |
| 86 | |
| 87 | if (!mEnabled) |
| 88 | return; |
| 89 | |
| 90 | ofPushStyle(); |
| 91 | ofPushMatrix(); |
| 92 | |
| 93 | ofSetLineWidth(2); |
| 94 | |
| 95 | float w, h; |
| 96 | GetDimensions(w, h); |
| 97 | |
| 98 | ofBeginShape(); |
| 99 | |
| 100 | const int autocorrelationDelay = 90; |
| 101 | |
| 102 | ofSetColor(0, 255, 0, 30); |
| 103 | for (int i = mOffset; i < NUM_LISSAJOUS_POINTS + mOffset - autocorrelationDelay; ++i) |
| 104 | { |
| 105 | float x = w / 2 + mLissajousPoints[i % NUM_LISSAJOUS_POINTS].x * w * mScale; |
| 106 | float y; |
| 107 | if (mAutocorrelationMode || mOnlyHasOneChannel) |
| 108 | y = h / 2 + mLissajousPoints[(i + autocorrelationDelay) % NUM_LISSAJOUS_POINTS].x * h * mScale; |
| 109 | else |
| 110 | y = h / 2 + mLissajousPoints[i % NUM_LISSAJOUS_POINTS].y * h * mScale; |
| 111 | //float alpha = (i-mOffset)/float(NUM_LISSAJOUS_POINTS-autocorrelationDelay); |
| 112 | ofVertex(x, y); |
| 113 | } |
| 114 | |
| 115 | ofEndShape(); |
| 116 | |
| 117 | ofPopMatrix(); |
| 118 | ofPopStyle(); |
| 119 | } |
| 120 | |
| 121 | void Lissajous::Resize(float w, float h) |
| 122 | { |
nothing calls this directly
no test coverage detected