7 #include <unordered_map>
17 std::unordered_map<string, TerrainMesh> terrains;
22 float pos[] = {0., 0., 0.};
23 Scene(
"fps", 90, pos);
26 Scene(std::string type,
int fov,
float position[3]) {
57 terrains[terrain.
getName()] = terrain;
64 return terrains[mesh_name];
90 std::to_string(pos[0]) +
COMMA +
91 std::to_string(pos[1]) +
COMMA +
92 std::to_string(pos[2]) +
103 for (
auto t : terrains) {
120 for (
int i = 0; i < tr.
getRows(); i++) {
122 for (
int j = 0; j < tr.
getCols(); j++) {
123 scene_json += std::to_string(verts[k++]) +
COMMA;
126 scene_json.erase(scene_json.size() - 1);
130 scene_json.erase(scene_json.size() - 1);
138 for (
int i = 0; i < tr.
getRows(); i++) {
140 for (
int j = 0; j < tr.
getCols(); j++) {
141 string col_str = std::to_string(colors[k])
142 +
COMMA + std::to_string(colors[k + 1])
143 +
COMMA + std::to_string(colors[k + 2])
144 +
COMMA + std::to_string(colors[k + 3]);
150 scene_json.erase(scene_json.size() - 1);
154 scene_json.erase(scene_json.size() - 1);
void setType(string t)
Definition: Camera.h:40
int getFov() const
Definition: Camera.h:44
string getType() const
Definition: Camera.h:36
void setPosition(float p[3])
Definition: Camera.h:52
void getPosition(float *p) const
Definition: Camera.h:55
void setFov(int f)
Definition: Camera.h:48
Scene()
Definition: Scene.h:21
Scene(std::string type, int fov, float position[3])
Definition: Scene.h:26
void setCamera(Camera &c)
add function for Camera objects
Definition: Scene.h:42
virtual const string getDataStructureRepresentation() const override
remove function for TerrainMesh objects
Definition: Scene.h:74
TerrainMesh & get(string mesh_name)
add function for TerrainMesh objects
Definition: Scene.h:63
void add(TerrainMesh terrain)
add function for TerrainMesh objects
Definition: Scene.h:56
Camera getCamera()
get the current camera
Definition: Scene.h:49
virtual const string getDStype() const override
Get data structure type.
Definition: Scene.h:35
Definition: TerrainMesh.h:10
vector< float > & getVertices()
Definition: TerrainMesh.h:75
vector< float > & getColors()
Definition: TerrainMesh.h:67
int getRows()
Definition: TerrainMesh.h:51
string getName()
Definition: TerrainMesh.h:39
int getCols()
Definition: TerrainMesh.h:59
string getType()
Definition: TerrainMesh.h:47
This is the superclass of all data structure types in BRIDGES.
Definition: DataStructure.h:74
Support for drawing Bar charts.
Definition: alltypes.h:4
const string COLON
Definition: DataStructure.h:52
const string OPEN_BOX
Definition: DataStructure.h:55
const string COMMA
Definition: DataStructure.h:51
const string OPEN_CURLY
Definition: DataStructure.h:53
const string CLOSE_BOX
Definition: DataStructure.h:56
const string CLOSE_CURLY
Definition: DataStructure.h:54
const string QUOTE
Definition: DataStructure.h:50