summaryrefslogtreecommitdiff
path: root/ofxHelios/src/colourPolyline.cpp
blob: 24b1e0085ae4297431b64bd631f45aded673f669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
	}
}