summaryrefslogtreecommitdiff
path: root/ofxHelios/src/colourPolyline.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-01-28 22:20:49 +0000
committerTim Redfern <tim@getdrop.com>2018-01-28 22:20:49 +0000
commit64c89ab53447a004002ec0b0db94fd0a1e632cf6 (patch)
tree65ce3b4802bbb0656cc1a8c843c81d7a3fcda8c9 /ofxHelios/src/colourPolyline.cpp
parent404746784ce6ef2b87c396a12451947fee28b244 (diff)
POC driver
Diffstat (limited to 'ofxHelios/src/colourPolyline.cpp')
-rw-r--r--ofxHelios/src/colourPolyline.cpp40
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
+ }
+}