Bridges-C++ 3.5.0-dev2-1-ge3e57bf
Bridges(C++ API)
TerrainMesh.h
Go to the documentation of this file.
1#ifndef TERRAIN_MESH
2
3#define TERRAIN_MESH
4
5#include <string>
6#include <vector>
7using namespace std;
8
9namespace bridges {
11
12 private:
13 string name;
14 string type;
15 vector<float> vertices;
16 vector<float> colors;
17 int rows;
18 int cols;
19
20 public:
22 TerrainMesh(string id, int r, int c, vector<float> elevation_data) {
23 name = id;
24 type = "terrain";
25 rows = r;
26 cols = c;
27 vertices = elevation_data;
28 // set color for each vertex
29 for (int i = 0; i < rows; i++)
30 for (int j = 0; j < cols; j++)
31 for (int k = 0; k < 4; k++)
32 colors.push_back(1.);
33 }
34
35 void setName (string n) {
36 name = n;
37 }
38
39 string getName () {
40 return name;
41 }
42
43 void setType (string t) {
44 type = t;
45 }
46
47 string getType () {
48 return type;
49 }
50
51 int getRows() {
52 return rows;
53 }
54
55 void setRows(int r) {
56 rows = r;
57 }
58
59 int getCols() {
60 return cols;
61 }
62
63 void setCols(int c) {
64 cols = c;
65 }
66
67 vector<float>& getColors() {
68 return colors;
69 }
70
71 void setColors(vector<float>& cols) {
72 colors = cols;
73 }
74
75 vector<float>& getVertices() {
76 return vertices;
77 }
78
79 void setVertices(vector<float>& v) {
80 vertices = v;
81 }
82 };
83} //namespace bridges
84
85#endif
Definition: TerrainMesh.h:10
TerrainMesh()
Definition: TerrainMesh.h:21
void setVertices(vector< float > &v)
Definition: TerrainMesh.h:79
void setName(string n)
Definition: TerrainMesh.h:35
int getRows()
Definition: TerrainMesh.h:51
void setType(string t)
Definition: TerrainMesh.h:43
string getName()
Definition: TerrainMesh.h:39
void setCols(int c)
Definition: TerrainMesh.h:63
int getCols()
Definition: TerrainMesh.h:59
string getType()
Definition: TerrainMesh.h:47
void setRows(int r)
Definition: TerrainMesh.h:55
vector< float > & getVertices()
Definition: TerrainMesh.h:75
TerrainMesh(string id, int r, int c, vector< float > elevation_data)
Definition: TerrainMesh.h:22
vector< float > & getColors()
Definition: TerrainMesh.h:67
void setColors(vector< float > &cols)
Definition: TerrainMesh.h:71
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4