diff options
Diffstat (limited to 'ofxHelios/src/colourPolyline.cpp')
| -rw-r--r-- | ofxHelios/src/colourPolyline.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ofxHelios/src/colourPolyline.cpp b/ofxHelios/src/colourPolyline.cpp new file mode 100644 index 0000000..24b1e00 --- /dev/null +++ b/ofxHelios/src/colourPolyline.cpp @@ -0,0 +1,40 @@ +#include "colourPolyline.h" + + +void colourPolyline::addVertex( float x, float y){ + addVertex(ofPoint(x,y)); +} + +void colourPolyline::addVertex( const ofPoint& p ){ + addVertex(p, ofColor(255,255,255)); +} + +void colourPolyline::addVertex( float x, float y, int r, int g, int b){ + addVertex(ofPoint(x,y),ofColor(r,g,b)); +} + +void colourPolyline::addVertex( const ofPoint& p , int r, int g, int b){ + addVertex(p,ofColor(r,g,b)); +} + +void colourPolyline::addVertex( const ofPoint& p , const ofColor& c){ + ofPolyline::addVertex(p); + pointColours.push_back(c); +} + + + +ofColor colourPolyline::getColourAt(int i){ + return pointColours[i]; +} + +void colourPolyline::draw(){ + for (int i=0;i<ofPolyline::size()-1;i++){ + ofSetColor(pointColours[i]); + ofPolyline l; + l.addVertex(ofPolyline::operator[](i)); + l.addVertex(ofPolyline::operator[](i+1)); + l.draw(); + //todo - cache + } +} |
