-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph.cpp
More file actions
41 lines (35 loc) · 902 Bytes
/
Graph.cpp
File metadata and controls
41 lines (35 loc) · 902 Bytes
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Graph.cpp
* Author: evgeny
*
* Created on 7 марта 2018 г., 21:55
*/
#include "Graph.h"
Graph::Graph(std::vector<GLfloat> x, std::vector<GLfloat> y, GLfloat color[3]) {
int size = (x.size()<y.size()) ? x.size() : y.size();
drawMode = GL_LINES;
for (int i = 0; i < size; i++)
{
points.push_back(x[i]);
points.push_back(y[i]);
points.push_back(0);
points.push_back(color[0]);
points.push_back(color[1]);
points.push_back(color[2]);
}
for (int i = 0; i < size - 1; i++)
{
indices.push_back(i);
indices.push_back(i + 1);
}
setup();
}
Graph::Graph(const Graph& orig) {
}
Graph::~Graph() {
}