blob: 29f9951fa7e4acf0225039b0df0586bcd4229682 (
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
|
#pragma once
#include "ofPolyline.h"
#include "ofMain.h"
class colourPolyline: public ofPolyline {
public:
colourPolyline(){}
colourPolyline(const ofPolyline line,const ofColor colour=ofColor(255,255,255)){
for (auto& point:line){
addVertex(point, colour);
}
}
void clear(){
ofPolyline::clear();
pointColours.clear();
}
void addVertex( float x, float y);
void addVertex( const ofPoint& p );
void addVertex( float x, float y, int r, int g, int b);
void addVertex( const ofPoint& p , int r, int g, int b);
void addVertex( const ofPoint& p , const ofColor& c);
void draw();
const ofColor getColourAt(const int i);
private:
vector <ofColor> pointColours;
};
|