diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-01-24 23:40:49 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-01-24 23:40:49 +0000 |
| commit | 404746784ce6ef2b87c396a12451947fee28b244 (patch) | |
| tree | b6217e1087993588d19fd6d51e24997d67ee2d4e /drawing/src/colourPolyline.cpp | |
| parent | 60b2973637d6150f3facb74eb9ae1d475071b915 (diff) | |
colourPolyline
Diffstat (limited to 'drawing/src/colourPolyline.cpp')
| -rw-r--r-- | drawing/src/colourPolyline.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drawing/src/colourPolyline.cpp b/drawing/src/colourPolyline.cpp new file mode 100644 index 0000000..810488d --- /dev/null +++ b/drawing/src/colourPolyline.cpp @@ -0,0 +1,21 @@ +#include "colourPolyline.h" + +void colourPolyline::addVertex( const ofPoint& p , const ofColor& c){ + ofPolyline::addVertex( p ); + pointColours.push_back( c ); +} + +void colourPolyline::addVertex( const ofPoint& p ){ + addVertex( p , ofColor(255,255,255)); +} + +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 + } +} |
