summaryrefslogtreecommitdiff
path: root/drawing/src/colourPolyline.cpp
blob: 810488d96654636c2d3098c319f5988ca0c077f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
	}
}